# Making requests

> Send JSON arrays of up to 100 tasks, set per-task controls, and understand request-level and task-level limits.

## Task arrays

DataForSEO-shaped routes (SERP, Pages, AI answers, `my_business_info`) take a `POST` with a JSON array of task objects. Each task is independent: it's validated, run, billed and reported on its own.

```bash
curl -X POST "https://api.dataforgaio.com/v1/serp/google/organic/task_post" \
  -u "api:$DATAFORGAIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    { "keyword": "trail running shoes", "location_code": 2840, "language_code": "en", "tag": "kw-1" },
    { "keyword": "waterproof hiking boots", "location_code": 2826, "language_code": "en", "tag": "kw-2" }
  ]'
```

- **Up to 100 tasks per request.** More returns `40006` (HTTP 400) and nothing runs.
- **A single object works too.** We treat `{...}` as `[{...}]`.
- **`tasks` comes back in the order you sent.** Each entry echoes your task in `data`, so you can match them without relying on order.
- **One bad task doesn't sink the rest.** A task with an invalid field comes back with `40501` and `cost: 0`; the others run.
- **`live` and `task_post` routes need `POST`.** A `GET` on them returns `40503` with HTTP 405.

## Request controls

Every task on a compatible route accepts four optional fields on top of the endpoint's own:

| Field | Type | Default | What it does |
|---|---|---|---|
| `auto_upgrade` | boolean | `true` | Lets a blocked request move to a higher fetch level, billed at that level's price. `false` stays at the included level. |
| `max_level` | `standard` \| `rendered` \| `protected` | `protected` | The highest fetch level the task may use. |
| `max_cost` | number (USD) | none | The most this task may cost. We never upgrade past it. |
| `max_age` | integer (seconds, 0 to 86400) | the endpoint's cache window | How old a cached result may be. `0` always fetches fresh. |

A bad value (for example `"max_level": "turbo"`) fails that task with `40501` and an exact message. These are explained in [Fetch levels and Auto-upgrade](https://dataforgaio.com/docs/fetch-levels-and-auto-upgrade.md) and [Caching and max_age](https://dataforgaio.com/docs/caching-and-max-age.md).

On the Scale SERP, Outscraper and Apify routes, send the same four fields as query parameters or in the JSON body. On the Crawl API, `auto_upgrade`, `max_level` and `max_cost` go in the request body; `max_age` doesn't apply.

## Other request shapes

| Route | Method | Body |
|---|---|---|
| `/v1/business/google/products` | `GET` | Scale SERP query parameters (`data_cid`, `hl`) |
| `/v1/business/google/photos` | `GET` | Outscraper query parameters (`query`, `photosLimit`, `tag`, `language`, `region`) |
| `/v1/ads/meta`, `/v1/ads/yelp` | `POST` | One Apify actor input object |
| `/v1/crawls`, `/v1/crawls/batch`, `/v1/map`, `/v1/serp` | `POST` | One JSON object |
| `tasks_ready`, `task_get`, `/v1/account/...`, `locations`, `languages`, `models` | `GET` | None, or query parameters |

## Encoding

- Send `Content-Type: application/json` and UTF-8 JSON. A body that isn't valid JSON returns `40503` ("POST Data Is Invalid").
- Request bodies are limited to 20 MB.
- Keywords are plain text up to 700 characters on SERP routes. Don't URL-encode them inside JSON.
- URLs (`url` on Pages and Crawl API routes) must be absolute `http` or `https` URLs, at most 2,000 characters, on a public host.
- Money fields in responses are JSON numbers in USD (`"cost": 0.00054`). Receipts on the Crawl API use numbers too.
- Timestamps: compatible routes use DataForSEO's `"2026-12-03 09:00:00 +00:00"` in `datetime`, plus an ISO 8601 `fetched_at` (`"2026-12-03T09:00:00Z"`). Crawl API routes use ISO 8601 throughout.

## Limits at a glance

| Limit | Value | Where it's set |
|---|---|---|
| Tasks per `POST` on compatible routes | 100 | [Making requests](#task-arrays) |
| Targets per Crawl API batch | 100 | [Working with large batches](https://dataforgaio.com/docs/large-batches.md) |
| Requests per minute | 120 per API key | [Rate limits and concurrency](https://dataforgaio.com/docs/rate-limits.md) |
| Inline Crawl API requests in flight | 10 per organization | [Rate limits and concurrency](https://dataforgaio.com/docs/rate-limits.md) |
| `max_age` | 0 to 86,400 seconds | [Caching and max_age](https://dataforgaio.com/docs/caching-and-max-age.md) |
| Organic SERP `depth` | 1 to 200 | [Google Organic SERP: Live Advanced](https://dataforgaio.com/docs/api/serp-google-organic-live-advanced.md) |
| Stored task results | 30 days | [Data retention](https://dataforgaio.com/docs/data-retention.md) |

> **Tip:** Live requests run every task before responding, one after another. A live request with 100 SERP tasks can take minutes. For more than a handful of tasks, use `task_post` and collect results as they finish. See [Choosing a mode](https://dataforgaio.com/docs/choosing-a-mode.md).
