---
title: "Request"
description: "Send your own HTTP request (method, headers, body) to a public site and get the site's status, headers and body back as they arrived."
---

> Every apinoa docs page as markdown: https://apinoa.com/llms.txt (all in one file: https://apinoa.com/llms-full.txt; this API family in one file: https://apinoa.com/docs/web/llms.txt)

```http
POST /v1/unlocker/request
```

Send the parameters as a JSON body (`Content-Type: application/json`). `headers` is a JSON object of header names to
values, and `body` is a string. The `x-api-key` header is your apinoa key; the `headers` inside the body are what
the site receives.

## Request

Calling an API with your own token, as a JSON `POST`:

```bash tab="cURL"
curl -X POST "https://gateway.apinoa.com/v1/unlocker/request" \
  -H "x-api-key: $APINOA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://httpbin.org/anything?q=shoes",
    "method": "POST",
    "headers": { "content-type": "application/json", "authorization": "Bearer YOUR_TOKEN" },
    "body": "{\"q\":\"shoes\"}"
  }'
```

```js tab="JavaScript"
const res = await fetch("https://gateway.apinoa.com/v1/unlocker/request", {
  method: "POST",
  headers: { "x-api-key": process.env.APINOA_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    url: "https://httpbin.org/anything?q=shoes",
    method: "POST",
    headers: { "content-type": "application/json", authorization: "Bearer YOUR_TOKEN" },
    body: JSON.stringify({ q: "shoes" }),
  }),
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import json
import os

import requests

res = requests.post(
    "https://gateway.apinoa.com/v1/unlocker/request",
    json={
        "url": "https://httpbin.org/anything?q=shoes",
        "method": "POST",
        "headers": {"content-type": "application/json", "authorization": "Bearer YOUR_TOKEN"},
        "body": json.dumps({"q": "shoes"}, separators=(",", ":")),
    },
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## Parameters

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `url` | string | yes | The address to request (http or https). |
| `body` | string |  |  |
| `bodyEncoding` | enum |  | `text` `base64` |
| `country` | enum |  | `US` |
| `followRedirects` | boolean |  |  |
| `headers` | object |  | Headers to send, as given. A real browser's own headers replace User-Agent, sec-ch-ua*, Accept-Encoding, Host, Connection and Content-Length. |
| `method` | enum |  | `GET` `POST` `PUT` `PATCH` `DELETE` `HEAD` |
| `profile` | enum |  | Which kind of browser to present: desktop or mobile. Absent: either. `desktop` `mobile` |

The same parameters, and every response type, are in the OpenAPI document: https://apinoa.com/openapi.json

- `body` is at most 2 MiB, and a `GET` or `HEAD` request has none. For binary data, send it as base64 with
  `bodyEncoding: "base64"`.
- `profile` picks the kind of browser the request is sent as: `desktop` or `mobile`. Leave it out and one is
  chosen for you, and changed when a site refuses it.
- At most 50 headers.

## What Is Sent

Every header you pass is sent, except those that make up the browser's identity. Those are replaced with a real
browser's own, because a value that disagrees with the rest of the request is the commonest reason a site refuses
it:

| Header | What Happens |
|---|---|
| `User-Agent`, `sec-ch-ua*` | Replaced by the browser's own |
| `Accept-Encoding` | Replaced. The answer's body is returned decompressed |
| `Host`, `Content-Length` | Set from `url` and `body` |
| `Connection`, `Keep-Alive`, `Transfer-Encoding`, `TE`, `Upgrade`, `Proxy-Authorization`, `Proxy-Connection` | Dropped |
| Everything else (`Authorization`, `Cookie`, `Content-Type`, `Accept`, your own `X-*`) | Sent as you wrote it |

Redirects are followed unless `followRedirects` is `false`, which returns the `3xx` itself. A redirect to another
origin (a different scheme, host or port) does not carry your `Authorization` or `Cookie` header on. A `303`, or a
`301` or `302` answering a `POST`, `PUT`, `PATCH` or `DELETE`, is followed with a `GET` without the body, as a
browser does.

## Response

Returns [`UnlockResult`](/docs/api-reference/web-data/response-schema#unlockresult) in `data`. A real response, in
full: httpbin echoes back the request it received, so `body` shows what the site was sent (the address in `origin`
is replaced with a documentation address).

```json
{
  "success": true,
  "data": {
    "status": 200,
    "url": "https://httpbin.org/anything?q=shoes",
    "headers": {
      "Access-Control-Allow-Credentials": "true",
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Expose-Headers": "Retry-After, RateLimit, RateLimit-Policy, WWW-Authenticate",
      "Content-Type": "application/json",
      "Date": "Fri, 20 Nov 2026 09:42:23 GMT",
      "X-Content-Type-Options": "nosniff"
    },
    "body": "{\n  \"args\": {\n    \"q\": \"shoes\"\n  },\n  \"headers\": {\n    \"Accept\": \"application/json\",\n    \"Accept-Encoding\": \"gzip, deflate, br, zstd\",\n    \"Accept-Language\": \"en-US,en;q=0.9\",\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n    \"Cache-Control\": \"no-cache\",\n    \"Content-Length\": \"13\",\n    \"Content-Type\": \"application/json\",\n    \"Host\": \"httpbin.org\",\n    \"Pragma\": \"no-cache\",\n    \"Priority\": \"u=1, i\",\n    \"Sec-Ch-Ua\": \"\\\"Not;A=Brand\\\";v=\\\"8\\\", \\\"Chromium\\\";v=\\\"150\\\", \\\"Google Chrome\\\";v=\\\"150\\\"\",\n    \"Sec-Ch-Ua-Mobile\": \"?0\",\n    \"Sec-Ch-Ua-Platform\": \"\\\"Windows\\\"\",\n    \"Sec-Fetch-Dest\": \"empty\",\n    \"Sec-Fetch-Mode\": \"cors\",\n    \"Sec-Fetch-Site\": \"same-origin\",\n    \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36\"\n  },\n  \"method\": \"POST\",\n  \"origin\": \"203.0.113.7\",\n  \"url\": \"https://httpbin.org/anything?q=shoes\",\n  \"data\": \"{\\\"q\\\":\\\"shoes\\\"}\",\n  \"files\": {},\n  \"form\": {},\n  \"json\": {\n    \"q\": \"shoes\"\n  }\n}\n",
    "bodyEncoding": "text"
  }
}
```

## Errors

| Status | Code | Meaning |
|---|---|---|
| 400 | `INVALID_PARAMS` | A parameter is missing, unknown or out of range: `url` is not an http or https address, a `GET` or `HEAD` has a `body`, a `base64` body is not base64, the body is over 2 MiB, or there are more than 50 headers. Also: the host is refused (see below). The message says which. |
| 400 | `UPSTREAM_TOO_LARGE` | The site's answer is larger than 10 MiB. |
| 400 | `INVALID_PARAMS` | The site's TLS certificate does not verify (it is checked on every request). The message names the host. |
| 401 | `UNAUTHORIZED` | The `x-api-key` header is missing, or the key is revoked or unknown. |
| 402 | `INSUFFICIENT_CREDITS` | Your credits do not cover this call. Choose a plan or top up in the dashboard. |
| 404 | `NOT_FOUND` | The site does not exist or refuses connections: its name does not resolve, or nothing accepts the connection. The message names the host. |
| 429 | `MARKETPLACE_SATURATED` | Too many concurrent calls. Retry after the `Retry-After` seconds. |
| 503 | `UPSTREAM_UNAVAILABLE` | The site stayed behind a bot check after every try. Retry later. |

Every code is listed in [Errors](/docs/errors). Failed calls are not billed.

### Refused Hosts

These are refused with `INVALID_PARAMS`, on the first request and on every redirect:

- **Sites an apinoa API serves.** Amazon, Walmart, TikTok Shop, AliExpress, Reddit, LinkedIn, TikTok, YouTube,
  Threads, X, Instagram, Facebook, Google (search, Shopping, Play, Trends, Gemini), Bing, Copilot, Naver, Daum, Yahoo
  search, Yahoo! JAPAN, Yandex, Baidu, Sogou, Seznam, DuckDuckGo, Tripadvisor, the App Store, ChatGPT, Doubao and Qwen,
  with their image and video hosts. The message names the API to call instead, e.g.
  `www.amazon.com is served by the amazon API — call /amazon/… instead of the unlocker`.
- **Government and military sites** (`.gov`, `.mil`, `gov.uk`, `go.kr`, `europa.eu` and other countries'
  government domains).
- **Private and internal addresses** (`localhost`, `10.0.0.0/8`, `192.168.0.0/16`, internal names).

## Pricing

**Price** 1 credit per started MiB of the answer's body: an answer up to 1 MiB costs 1 credit, one of 1.2 MiB costs
2 credits, and the largest, 10 MiB, costs 10 credits.

## Notes

- **The site's answer is returned as it is.** A `404`, a `500` or a plain `403`, `429` or `503` from the site is its
  answer: returned with its `status`, and billed. A bot-check page is not: a request a site blocks is retried
  automatically, and one still blocked is `UPSTREAM_UNAVAILABLE`, not billed.
- **Text or base64.** A textual answer that is valid UTF-8 comes back as text in `body`; anything else (an image, a
  PDF, a zip) as base64, with `bodyEncoding: "base64"`. Decoded, it is the site's bytes exactly.
- **No JavaScript is run.** The answer is what the site's server sends.
- TLS certificates are always checked. `country` is `US`, the only value.
- Fields of every type are in the [Response Schema](/docs/api-reference/web-data/response-schema).
