The API that powers CookieTrack.
CookieTrack's OpenAPI documentation can be found here.
Contribution guidelines can be found here.
The API endpoint at https://api.cookietrack.io currently has a rate limit of 200 calls every 6 hours.
This is so that everyone can enjoy the API without overloading it for others.
If you'd like to host it yourself to use without restrictions, refer to the Self-Hosting section below.
This repository is already setup for Firebase hosting, but could easily be adapted to be deployed on AWS or any other cloud deployment service.
-
Add your own API keys in
functions/static/keys.json. An example file is provided. -
Install dependencies by navigating to the
functionsfolder and usingnpm i. -
Deploying to Firebase can be done through
npm run deploy. The script is already setup to compile from Typescript, update theroutes.jsonfile, etc.
If you wish to test endpoints locally, you have the following options in the index.ts file:
-
Test locally by setting
localTestingtotrueand runningnpm start. -
Alternatively, you could test through Firebase's emulators by setting
emulatorTestingtotrueinstead and runningnpm run emulator. -
Be sure to turn off rate limiting by setting
rateLimitedtofalse!
The cookietrack-types npm package includes common typings for the API. Check out its repository here.