String Web Access API
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/fetch

Request body

Unknown fields are rejected. url is the only required field.

FieldTypeDefaultDescription
urlstring (URL)Required. The http/https URL to fetch.
methodGET POST PUT PATCHGETHTTP method (case-insensitive). body is only valid for non-GET.
bodystring | objectRequest body for POST/PUT/PATCH. Objects are JSON-stringified. Forbidden on GET.
formatjson raw markdownjsonResponse format.
jsonSchemaobjectJSON Schema to extract into. Requires format: json.
executeJSbooleanRender in a browser. Incompatible with headers.
requireWSSbooleanRequire a browser WebSocket fetch path. Incompatible with headers.
headersobjectCustom headers (max 50). Direct fetch only.
countryCodestring(2)ISO 3166-1 alpha-2 proxy country.
solveCaptchabooleantrueCaptcha solving. false fails on a challenge.
screenshotbooleanCapture a screenshot. Shorthand for one screenshot action.
actionsarrayBrowser actions to run (1–50).

Field compatibility

  • body is forbidden on GET.
  • jsonSchema requires format: json.
  • headers cannot be combined with executeJS or requireWSS.
  • screenshot and actions are mutually exclusive, and when either is set the request may not also use method (other than GET), a non-json format, body, headers, jsonSchema, or solveCaptcha: 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

StatusMeaning
200Successful fetch. Body shape depends on format (and jsonSchema).
400Validation error — bad input, or a path requiring KYC.
401Missing or invalid API key.
402Insufficient account balance.
403Destination not enabled for your organization.
429Rate limit exceeded.
502Upstream/destination error.
500Internal 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.