Checking API requests usage
In the API, we also expose
/usage endpoind to let you check the status of active request packs associated with your account.
Each successful request to Scraping Fish API is worth exactly one API request regardless of query parameters or other options.
To get the current status of API requests available for your account, you can call
/usage endpoint with
api_key query parameter as follows:
response = requests.get("https://scraping.narf.ai/api/v1/usage/?api_key=[your API key]")
const axios = require("axios");
const response = await axios.get("https://scraping.narf.ai/api/v1/usage/?api_key=[your API key]");
curl -G 'https://scraping.narf.ai/api/v1/usage/?api_key=[your API key]'
In the response, you get a list of your valid API request packs sorted in ascending order by expiration date, for example:
"expires": "24 Feb 2024 20:00:00 GMT"
total: the total number of API requests you purchased in this pack,
left: the number of API requests left in this pack,
expires: API requests pack expiration date in UTC.
This information is also available in the Scraping Fish dashboard after you log in to your account.
If you currently do not have any API requests available, the list in the response will be empty.
API requests are always subtracted from the request pack with the earliest expiration date.
/usage endpoint does not affect your available API requests.