API Reference
POST /fetch
Full request and response reference for the Web Access API fetch endpoint.
Executes an HTTP/HTTPS request to a URL and returns the result, choosing the best fetch strategy automatically.
POST https://request.usestring.ai/v1/fetchRequest body
Unknown fields are rejected. url is the only required field.
| Field | Type | Default | Description |
|---|---|---|---|
url | string (URL) | — | Required. The http/https URL to fetch. |
method | GET POST PUT PATCH | GET | HTTP method (case-insensitive). body is only valid for non-GET. |
body | string | object | — | Request body for POST/PUT/PATCH. Objects are JSON-stringified. Forbidden on GET. |
format | json raw markdown | json | Response format. |
jsonSchema | object | — | JSON Schema to extract into. Requires format: json. |
executeJS | boolean | — | Render in a browser. Incompatible with headers. |
requireWSS | boolean | — | Require a browser WebSocket fetch path. Incompatible with headers. |
headers | object | — | Custom headers (max 50). Direct fetch only. |
countryCode | string(2) | — | ISO 3166-1 alpha-2 proxy country. |
solveCaptcha | boolean | true | Captcha solving. false fails on a challenge. |
screenshot | boolean | — | Capture a screenshot. Shorthand for one screenshot action. |
actions | array | — | Browser actions to run (1–50). |
Field compatibility
bodyis forbidden onGET.jsonSchemarequiresformat: json.headerscannot be combined withexecuteJSorrequireWSS.screenshotandactionsare mutually exclusive, and when either is set the request may not also usemethod(other thanGET), a non-jsonformat,body,headers,jsonSchema, orsolveCaptcha: false.
Example
curl https://request.usestring.ai/v1/fetch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://httpbin.org/json",
"format": "json"
}'Responses
| Status | Meaning |
|---|---|
200 | Successful fetch. Body shape depends on format (and jsonSchema). |
400 | Validation error — bad input, or a path requiring KYC. |
401 | Missing or invalid API key. |
402 | Insufficient account balance. |
403 | Destination not enabled for your organization. |
429 | Rate limit exceeded. |
502 | Upstream/destination error. |
500 | Internal error. |
200 — JSON format
{
"statusCode": 200,
"headers": { "content-type": ["application/json"] },
"data": { "message": "Hello World" }
}For raw, the body is the gzip-compressed bytes with x-status-code set; for markdown, the body is text/markdown.
With jsonSchema, the body is the extracted object. With screenshot/actions, the body includes finalUrl, data
(final HTML), and an optional screenshot: { format, base64 }.
See Response formats and Screenshots & actions for each shape.