Credit balance API
The credits left for the team behind the key.
GET /v1/account/credits
GET /v1/account/credits
The credits left for the team behind the key. Free.
- Cost: Free
- Cache: Not cached.
Parameters#
This endpoint takes no parameters of its own.
Example request#
Set your key in the environment first (see Authentication).
1curl "https://api.socialscrape.dev/v1/account/credits" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY"1import os2import requests34res = requests.get(5 "https://api.socialscrape.dev/v1/account/credits",6 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},7)8body = res.json()910if body["ok"]:11 print(body["data"])12else:13 print(body["error"]["code"], body["error"]["message"])1const res = await fetch("https://api.socialscrape.dev/v1/account/credits", {2 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },3});4const body = await res.json();56if (body.ok) {7 console.log(body.data);8} else {9 console.error(body.error.code, body.error.message);10}1{2 "nodes": [3 {4 "name": "SocialScrape Credit balance",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/account/credits",14 "sendQuery": false,15 "sendHeaders": true,16 "headerParameters": {17 "parameters": [18 {19 "name": "x-api-key",20 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"21 }22 ]23 }24 }25 }26 ],27 "connections": {}28}Example response#
This is a sample with illustrative values. Status 200.
200 OKSample response
1{2 "ok": true,3 "credits_charged": 0,4 "credits_remaining": 5000,5 "cached": false,6 "cached_at": null,7 "request_id": "req_b0923da04322d1de219dc51e",8 "data": {9 "object": "credit_balance",10 "credits_remaining": 5000,11 "team_id": "team_01example"12 },13 "cursor": null,14 "has_more": null15}Response#
A CreditBalance object in data.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|
Every request can also fail with the account and platform errors listed on the Errors page.
Also served at#
These paths answer the same request, so code written for other APIs keeps working: /v1/account/credit-balance. See Switching from ScrapeCreators.
Related endpoints#
- Request history (
GET /v1/account/usage) - Daily usage (
GET /v1/account/usage/daily) - Most used endpoints (
GET /v1/account/usage/routes)