API reference / Account
Account balance
Written and maintained by The ProspectAPIs team
GET/v1/account
GET /v1/account is the ProspectAPIs operation getAccount, in the Account group of the REST API. The calling key's balance, this month's free records left and the current prices. Free, so an agent can check before a costed run instead of discovering the balance through a 402. Cost: free. Send your API key as a Bearer token in the Authorization header.
The quickstart shows this call in context, next to the first requests most integrations make.
Parameters
This operation takes no path or query parameters.
Responses
| Status | Meaning |
|---|---|
| 200 | The account's balance and prices. |
| 401 | The API key is missing or invalid. |
| 404 | No such record for this account. |
| 429 | Too many requests; retry after the window. |
Every error answers with the same JSON body, an error string and sometimes a code; the errors page lists each status and when it happens. A per-key 429 carries Retry-After; see rate limits.
200 response fields
The account's balance and prices. The body is a Account.
| Field | Type | Description |
|---|---|---|
| credits_remaining required | number | USD credits left. |
| free_records_remaining required | integer | Free records left this calendar month. |
| free_records_per_month required | integer | |
| free_period_start required | string (date) | The first day of the current free-record month (UTC). |
| price_per_record_usd required | number | |
| research_price_usd required | number or null | The price of one POST /v1/research, or null while research is not priced. |
Code samples
Each sample sends the same request. Set PROSPECTAPIS_KEY in your environment first. Values come from the spec's examples; replace them with your own.
curl https://api.prospectapis.com/v1/account \
-H "Authorization: Bearer $PROSPECTAPIS_KEY"const res = await fetch("https://api.prospectapis.com/v1/account", {
headers: { Authorization: `Bearer ${process.env.PROSPECTAPIS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json().catch(() => ({}))).error ?? res.statusText}`);
const data = await res.json();
console.log(data);import os, requests
res = requests.get(
"https://api.prospectapis.com/v1/account",
headers={"Authorization": f"Bearer {os.environ['PROSPECTAPIS_KEY']}"},
timeout=30,
)
res.raise_for_status()
data = res.json()
print(data)Billing
This call is free: it never spends credits or free records, so you can call it as often as the rate limit allows. Metered calls on the same key report your balance after each response in X-Credits-Remaining, and GET /v1/account shows it at any time.
Related
Previous operation: List recent deliveries. Next operation: Send feedback. Every operation, grouped by area, is on the API reference index.
Create a free account to get a key, then run the samples above with your own values.
Was this page helpful?