Making POST/PUT Requests

Some advanced users may want to send POST/PUT requests in order to scrape forms and API endpoints directly. You can do this by sending a POST/PUT request through ScraperAPI. The return value will be stringified. So if you want to use it as JSON, you will need to parse it into a JSON object.

  • API ENDPOINT REQUEST

# Replace POST with PUT to send a PUT request instead
curl -d 'foo=bar' \
-X POST \
"http://api.scraperapi.com/?api_key=APIKEY&url=http://httpbin.org/anything"

# For form data
curl -H 'Content-Type: application/x-www-form-urlencoded' \
'foo=bar' \
POST \
"http://api.scraperapi.com/?api_key=APIKEY&url=http://httpbin.org/anything"
  • PROXY MODE

//Replace POST with PUT to send a PUT request instead
curl -d 'foo=bar' \
-X POST \
-x "http://scraperapi:APIKEY@proxy-server.scraperapi.com:8001" -k "http://httpbin.org/anything"

//For form data
curl -H 'Content-Type: application/x-www-form-urlencoded' \
-F 'foo=bar' \
-X POST \
-x "http://scraperapi:APIKEY@proxy-server.scraperapi.com:8001" -k "http://httpbin.org/anything"

Last updated