AlterLabAlterLab
PricingComparePlaygroundBlogDocsChangelog
    AlterLabAlterLab
    PricingComparePlaygroundBlogDocsChangelog
    IntroductionQuickstartInstallationYour First Request
    REST APICrawl APIMap APISearch APIExtract APIJob PollingAPI KeysSessions APINew
    OverviewPythonNode.js
    JavaScript RenderingOutput FormatsPDF & OCRCachingWebhooksJSON Schema FilteringWebSocket Real-TimeBring Your Own ProxyProAuthenticated ScrapingNewHTTP Methods & BodiesNewStructured ExtractionAIWeb SearchSite MappingWeb CrawlingBatch ScrapingSchedulerChange DetectionCloud Storage ExportSpend LimitsOrganizations & TeamsAlerts & NotificationsOAuth2 Machine-to-MachineSupport & Tickets
    Structured ExtractionAIE-commerce ScrapingNews MonitoringPrice MonitoringMulti-Page CrawlingMonitoring DashboardAI Agent / MCPMCPAI Research AgentAISite CrawlingData Pipeline to Cloud
    PricingRate LimitsError CodesChangelogVersioning
    From FirecrawlFrom ApifyFrom ScrapingBee / ScraperAPIFrom Crawl4AIFrom SpiderFirecrawl v0 API ReferenceLegacy
    PlaygroundPricingStatus
    Guide
    New

    HTTP Methods & Request Bodies

    Go beyond GET scraping. Use AlterLab as a proxy for GraphQL queries and HTML form submissions — with the same anti-bot protections and response parsing you rely on for standard scraping.

    Milestone feature

    The method, body, and content_type parameters are part of the HTTP Method & Body Support milestone. They are available in the current API version.

    When to Use POST

    Standard scraping is a GET request — you fetch a URL and get HTML back. That covers most public pages. But many data sources expose their content only through POST requests:

    GraphQL Endpoints

    GraphQL APIs require a POST with a JSON body containing your query. The endpoint is a single URL and all data selection happens in the body.

    Form Submissions

    Some sites return dynamic content only after a form POST — search results, login-gated content, or multi-step flows that carry state in form fields.

    JSON APIs

    Many internal or undocumented APIs serve data as JSON in response to a POST. AlterLab can relay the request and return the raw JSON response.

    Webhook Triggers

    Some endpoints accept a bodyless POST to trigger an action and return data. AlterLab supports POST with or without a body.

    Parameters

    ParameterTypeDefaultDescription
    methodGET | POSTGETHTTP method to use when fetching the target URL. Default is GET (standard page scrape).
    bodystringnullRequest body to send. Must be a UTF-8 string. Maximum 1 MB (10 MB for high-volume/enterprise tiers). Cannot be used with method=GET.
    content_typestringapplication/jsonContent-Type header for the body. Supported: application/json, application/x-www-form-urlencoded, text/plain. Ignored when body is not set.

    GraphQL Use Case

    GraphQL APIs accept a POST request with a JSON body containing a query field (and optional variables). Set method=POST and pass the query as a JSON string in body.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://countries.trevorblades.com/graphql",
        "method": "POST",
        "body": "{\"query\": \"{ countries { name capital currency } }\"}",
        "content_type": "application/json"
      }'

    GraphQL with variables

    Include a variables field in your JSON body for parameterized queries:
    JSON
    {
      "query": "query GetCountry($code: ID!) { country(code: $code) { name capital } }",
      "variables": { "code": "US" }
    }

    Form Submission Use Case

    To simulate an HTML form submission, set content_type=application/x-www-form-urlencoded and encode your form fields in the body as key=value&key2=value2.

    Bash
    curl -X POST https://api.alterlab.io/api/v1/scrape \
      -H "X-API-Key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "url": "https://example.com/search",
        "method": "POST",
        "body": "q=web+scraping+api&category=tools&page=1",
        "content_type": "application/x-www-form-urlencoded"
      }'

    Form authentication flows

    If the form POST is part of a login flow, the server typically responds with a redirect and a session cookie. To handle redirects and maintain session state across steps, combine method=POST with the Authenticated Scraping guide.

    Decision Guide

    Use this table to pick the right method and content type for your use case:

    Goalmethodcontent_typeBody format
    Scrape a standard web pageGET— (omit)— (omit)
    GraphQL queryPOSTapplication/json{"query": "...", "variables": {}}
    HTML form submissionPOSTapplication/x-www-form-urlencodedkey=value&key2=val2
    POST to a JSON REST APIPOSTapplication/jsonJSON string

    Constraints & Limits

    Body size limit: 1 MB (10 MB for enterprise)

    The body field accepts up to 1 MB (1,048,576 bytes) for standard tiers, and up to 10 MB (10,485,760 bytes) for high-volume and enterprise tiers. This covers all standard GraphQL queries, form payloads, and REST request bodies.

    Body cannot be used with GET

    Providing a body when method=GET returns a 400 Bad Request. Use method=POST if you need to send a body.

    Caching is disabled for non-GET methods

    The cache parameter is ignored when method is not GET. Non-idempotent requests are never cached.

    UTF-8 strings only

    The body field must be a valid UTF-8 string. Binary payloads are not supported. For binary data, encode as base64 if the target API accepts it.

    Troubleshooting

    GraphQL returns an error response instead of data

    • Ensure body is a valid JSON string (not a raw object). Use JSON.stringify() or json.dumps().
    • Check that content_type is application/json. Some GraphQL servers reject requests without this header.
    • If the endpoint requires authentication, combine with the Authenticated Scraping guide to pass session cookies.

    Form submission returns the login page instead of results

    The server may expect a CSRF token in the form body. Fetch the page first with a GET request to extract the token, then replay the POST with the token included in your form body.

    400 error: body cannot be used with GET method

    You have set a body field while method is GET (or omitted, since GET is the default). Set method to POST or another appropriate value.

    Response is HTML instead of JSON

    If the target API redirects to a login page or error page, the content field will contain HTML rather than JSON. Check the HTTP status in the response metadata and verify the endpoint URL and authentication requirements.

    ← Previous: Authenticated ScrapingNext: Web Crawling →
    Last updated: March 2026

    On this page