Don't let API rate limiting ruin your day: Consigliere tracks token freshness and timeouts so your app can scrape to its heart's content while still abiding the site's TOS.
-
Load tokens into
Consigliere()
object. -
Retrieve token(s) like
Consigliere.getToken('token-type')
. -
Use tokens for app like normal.
-
When requests indicate expired or timed out, indicate so:
Consigliere.setToken('token-id','reset-timestamp')
or:Consigliere.expireTokenPermanent('token-id')
-
Retrieve new token(s) as needed.
$ npm install
$ node make
$ node make test
$ node make build
$ node make watch
- Experimenting with JS/ES6 and Python 3.X on Postgres variations.
-
Since an app can acquire 0 or more keys before initiating API requests the app must know how many requests before it should switch.
-> Store the rate limit with the token (eg.
timeoutAfterRequestCount(1000)
for 1000 requests). -
Not economical to request new token for each request.
-
Support up to 1,000,000 tokens?
-
When multiple client apps, how to select API key not 1) in-use and 2) not recently used.
-
Validation for all stored keys when possible.
-
Manipulating tokens carries security risk. Need to encrypt all phases to prevent loss of tokens. Maybe only store references in memory and explicitly retrieve from database?
- Read/Write tokens from disk into memory
- Exhaust/Expire tokens
- Test tokens
- Group/ungroup tokens into collections
- Database and file-based key retrieval
Available under the MIT License.