scrapingbee 422 url is required
Fixes ScrapingBee HTTP 422 url is required errors. Use when the ScrapingBee API rejects a request saying the url parameter is missing, even though you think you sent it. Not for 401 auth failures, 429 rate limits, or target-site blocks.
TL;DR
The url query parameter is missing, empty, or being sent in the wrong place. Send it as a URL-encoded query string parameter on a GET request with api_key alongside it, exactly as the docs specify.
scrapingbee 422 url is requiredUse this when
- ScrapingBee returns 422 with "url is required" on the /v1 request
- Your code passes the URL but the error persists (encoding or placement issue)
- Switching between the requests library, axios, and curl gives different results
Not for this skill when
- The API returns 401/403 (key invalid or restricted)
- The API returns 429 (rate limit; slow down)
- The target page loads but content is wrong (rendering or block issue, not params)
Steps
- Confirm you are using GET with both api_key and url as query parameters on https://app.scrapingbee.com/api/v1, each set to your values. Expected: both params visible in the request line of your debug log.
- URL-encode the target URL value (percent-encoding), especially & and ? inside it, or the API will split your target URL into its own params. Expected: the full target URL arrives as one url value.
- If using Python requests, pass params={"api_key": key, "url": target} rather than building the string yourself. Expected: requests handles encoding and the 422 disappears.
- Check you did not send url in the POST body or as a header; the /v1 endpoint reads query params. Expected: moving it to the query string resolves the error.
- Retry with curl to isolate client issues: curl -G with --data-urlencode for url. Expected: curl 200s means your HTTP client was mangling the params.
Variant phrasings
scrapingbee api 422 missing url parameter
The parameter must be a query param named exactly url, lower-case.
scrapingbee url is required error python
Use requests params dict; manual string building usually drops the encoding.
Tool/version compatibility
ScrapingBee API v1 (app.scrapingbee.com/api/v1). Same parameter contract applies to the async queue API; the error text is identical.
Why it happens
The endpoint validates that a non-empty url parameter is present in the query string before doing anything else. Common failures: passing the URL in the request body, forgetting to encode it so its own & chars truncate it, or a wrapper library that names the parameter differently (link, target, uri).
Edge cases / pitfalls
- An empty-string url 422s the same way as a missing one; check for empty variables before the call.
- Some proxies strip unknown query params; if curl works but your infra fails, check middleware.
- Read the key with os.environ.get("SCRAPINGBEEAPIKEY") and never print it.
- Treat 422s as parameter bugs, not a signal to retry harder; retrying an invalid request just burns quota.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_DGnbQNJBR64HaZkOoRKrIg