# User Data

`GET /v1/account/user_data`

Your login, organization, rate limit, wallet balance and the price list.

Family: Account

## Price

Unit: request

Free. Account routes never charge your wallet.

## Description

Call it to check the key works and see your balance before a large run. Free. Account routes never charge your wallet.

## Authentication

HTTP Basic auth: any login, with your `dg_` API key as the password. A `Bearer` token header with the key also works.

## Request

No request body.

_None._

### Example request

```bash
curl -X GET "https://api.dataforgaio.com/v1/account/user_data" \
  -u "api:$DATAFORGAIO_API_KEY"
```

## Response

| Field | Type | Description |
|---|---|---|
| `version` | string | Response format version, for example `0.1.20261203`. |
| `status_code` | integer | Status of the request as a whole. 20000 when it was accepted; each task has its own `status_code`. |
| `status_message` | string | Plain-language request status. |
| `time` | string | Time the whole request took, for example `1.8410 sec.` |
| `cost` | number | Sum of every task's `cost`, in USD. |
| `tasks_count` | integer | Number of tasks in `tasks`. |
| `tasks_error` | integer | Tasks whose `status_code` is 40000 or higher. |
| `tasks` | array<object> | One entry per task you sent, in the order you sent them. |
| `tasks.id` | string | Task id (a UUID). For task_post, use it with task_get. |
| `tasks.status_code` | integer | Outcome of this task. 20000 means data came back; 20100 means queued. See the status codes table. |
| `tasks.status_message` | string | Plain-language status. For 40501 it names the field that failed. |
| `tasks.time` | string | Time this task took on our side, for example `1.8203 sec.` |
| `tasks.cost` | number | What this task was charged, in USD. 0 when it returned no data. |
| `tasks.result_count` | integer | Number of entries in `result`. |
| `tasks.path` | array<string> | The route this task ran on, split into segments, starting with `v1`. |
| `tasks.data` | object | The task you sent, echoed back. Utility routes echo their query parameters. |
| `tasks.result` | array<object>\|null | One entry. |
| `tasks.result.login` | string | Email of the user who owns the API key. |
| `tasks.result.timezone` | string | Always `UTC`. Every time in the API is UTC. |
| `tasks.result.organization` | string | Organization the key belongs to. |
| `tasks.result.rates` | object | Rate limits. |
| `tasks.result.rates.limits` | object | Limits by window. |
| `tasks.result.rates.limits.minute` | object | Per-minute limit. |
| `tasks.result.rates.limits.minute.total` | integer | Requests per minute allowed for this key. |
| `tasks.result.money` | object | Wallet. |
| `tasks.result.money.balance` | number | Wallet balance in USD. |
| `tasks.result.money.currency` | string | Always `USD`. |
| `tasks.result.money.auto_top_up` | boolean | True when automatic top-up is on. |
| `tasks.result.price` | object | Your list prices for every supported paid route, keyed by route (`/v1/...`), then by mode or queue (`live`, `standard`, `priority`), in USD per unit. Routes priced by fetch level add `fetch_level` with the `rendered` and `protected` prices. Free routes aren't listed. |
| `tasks.receipt_id` | string\|null | Id of the ledger receipt for this task: what was fetched, at which level, and what was charged. Null for utility routes and failed checks. |
| `tasks.fetch_level` | string\|null | The fetch level that delivered the data: `standard`, `rendered` or `protected`. Null when the route doesn't fetch pages or nothing was fetched. one of `standard`, `rendered`, `protected` |
| `tasks.upgraded` | boolean | True when Auto-upgrade moved the request past the included level (or, for SERP, to the live path) and the charge reflects that. |
| `tasks.upgrade_reason` | string\|null | Why the request upgraded, in our level names and HTTP facts, for example `403 at standard; challenge page at rendered`. Null when it didn't upgrade. |
| `tasks.cache_hit` | boolean | True when the data came from the shared result cache instead of a new fetch. |

### Example response

```json
{
  "version": "0.1.20261203",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.4210 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "8cbb5b5c-8e15-5c82-9959-45f93cdad009",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.4210 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v1",
        "account",
        "user_data"
      ],
      "data": {},
      "result": [
        {
          "login": "dev@summitrunning.example",
          "timezone": "UTC",
          "organization": "Summit Running Co.",
          "rates": {
            "limits": {
              "minute": {
                "total": 120
              }
            }
          },
          "money": {
            "balance": 24.8731,
            "currency": "USD",
            "auto_top_up": true
          },
          "price": {
            "/v1/ads/meta": {
              "live": 0.00018
            },
            "/v1/ads/yelp": {
              "live": 0.00045
            },
            "/v1/ai/chat_gpt/llm_responses/live": {
              "live": 0.00054
            },
            "/v1/ai/chat_gpt/llm_responses/task_post": {
              "standard": 0.00018,
              "priority": 0.00054
            }
          }
        }
      ],
      "receipt_id": null,
      "fetch_level": null,
      "upgraded": false,
      "upgrade_reason": null,
      "cache_hit": false
    }
  ]
}
```

## Errors

| Code | When |
|---|---|
| 40100 | No credentials were sent (HTTP 401). |
| 40101 | The API key is missing, malformed or revoked (HTTP 401). |
| 40202 | Too many requests for this key (HTTP 429, with `Retry-After`). |
| 40503 | The body isn't a JSON array of task objects, or the method isn't POST (HTTP 400 or 405). |
| 40006 | More than 100 tasks in one POST (HTTP 400). |
| 40210 | Wallet balance below the worst case this POST could cost (HTTP 402). |
| 40501 | A task field failed validation. Returned per task; other tasks still run. |
| 50000 | The task returned no data because of an error on our side or upstream. $0. |

## Migrating

Replaces DataForSEO `/v3/appendix/user_data`. Same request body and response envelope; change the base URL and the key.

## Related

- [Errors](https://dataforgaio.com/docs/api/account-errors.md): Tasks that failed in the last 7 days, newest first.
- [Status](https://dataforgaio.com/docs/api/account-status.md): A health check that also confirms your key.
- [Webhook Resend](https://dataforgaio.com/docs/api/account-webhook-resend.md): Send a finished task's pingback and postback again.
- [Support Matrix](https://dataforgaio.com/docs/api/account-support-matrix.md): Every route we mirror, whether it's supported yet, and its list price.
- [Receipt](https://dataforgaio.com/docs/api/account-receipts.md): Look up the receipt behind any response's `receipt_id`.
