Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return credits and throttling data with lookup methods #44

Closed
lpellegr opened this issue Nov 30, 2022 · 1 comment
Closed

Return credits and throttling data with lookup methods #44

lpellegr opened this issue Nov 30, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lpellegr
Copy link
Contributor

As part of a new major version, the IpregistryClient API should be reworked to return a response that includes information about remaining credits and throttling when enabled, in addition to lookup data.

We should mimic what we did with the official TypeScript library:

https://github.com/ipregistry/ipregistry-javascript/blob/0f7120b647e33cf822e042955951f8beaf65709d/src/request.ts#L24

@lpellegr lpellegr self-assigned this Nov 30, 2022
@lpellegr
Copy link
Contributor Author

Until this issue is fixed, you can retrieve the number of credits remaining on your account as follows:

import json
import urllib.request
resource = urllib.request.urlopen('https://api.ipregistry.co/?key=YOUR_API_KEY')
print('Ipregistry credits remaining=', resource.headers['ipregistry-credits-remaining'])

Note the value for the number of credits is reflected in near real-time.

@lpellegr lpellegr added the enhancement New feature or request label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant