Skip to main content

POST Requests, Headers & Cookies

Sometimes the data you want lives behind a form submission, a JSON API, or a request that needs specific headers or cookies. OmniScrape forwards all of that to the target for you.

Making the target request a POST

Set method to POST and provide a body. The body can be a JSON object or a raw string.

curl -X POST https://api.omniscrape.io/v1/scrape \
-H "X-API-Key: $OMNISCRAPE_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.example.com/search",
"method": "POST",
"body": { "query": "wireless headphones", "page": 1 }
}'

The outer request to OmniScrape is always a POST. The method field controls how OmniScrape calls the target — so the example above sends a POST to https://api.example.com/search with the JSON body.

Custom headers

Use custom_headers to send things like Accept-Language, Referer, or an Authorization token the target expects.

{
"url": "https://api.example.com/data",
"custom_headers": {
"Accept-Language": "en-US",
"Referer": "https://example.com/",
"Authorization": "Bearer the-targets-token"
}
}
note

custom_headers are sent to the target site, not to OmniScrape. Your OmniScrape API key always goes in X-API-Key.

Custom cookies

Use custom_cookies to send a cookie jar with the request — useful when you already have a valid session cookie for the target.

{
"url": "https://example.com/account",
"custom_cookies": {
"session_id": "abc123",
"locale": "en"
}
}

For flows where you need to accumulate cookies across multiple requests (log in, then browse), use a session instead of managing cookies yourself.

Putting it together

A geo-targeted POST to a search API, in German, behind a session:

{
"url": "https://api.shop.example.com/search",
"method": "POST",
"body": { "q": "laufschuhe", "page": 1 },
"proxy": "residential:de",
"session_id": "de-search",
"custom_headers": { "Accept-Language": "de-DE" }
}