INDEPENDENT WEB SCRAPING GUIDE
Scrapestack API Documentation: Quickstart & Errors
An independent scrapestack API guide with the HTTPS endpoint, Python example, required parameters, common errors and links to official documentation.
Open APILayer's official quickstart or authentication and error reference. This is an independent guide on scrapestack.dev, not the operator of scrapestack.com. API keys, billing and account support are handled by the API provider.
What does the scrapestack API return?
The API fetches a target page and returns its HTML. Treat fetching and extraction as separate steps: you still need to parse the page for links, products or other fields, then export those records. For a complete local extraction example, start with how to scrape a website.
Endpoint and required parameters
GET https://api.scrapestack.com/scrape| Parameter | Purpose |
|---|---|
access_key | Your private API key from your scrapestack account. |
url | The complete target URL, encoded as a query parameter. |
These details follow the official quickstart, checked October 20, 2026. Keep your key in a local environment variable or server secret, never in public frontend code, a committed file or a shared request URL.
Python API request example
Save the following as scrapestack_api.py. It requires Python 3 and your own account key. It makes a real request only when you run it and may use your request allowance. Set SCRAPESTACK_ACCESS_KEY in your local environment first. The example uses HTTPS and saves the response as page.html.
"""One request to the third-party scrapestack API; requires your own key."""
import json
import os
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import urlopen
def fetch_html(target):
query = urlencode({"access_key": os.environ["SCRAPESTACK_ACCESS_KEY"], "url": target})
# Keep the full request URL out of logs: it contains your private API key.
try:
with urlopen("https://api.scrapestack.com/scrape?" + query, timeout=45) as response:
raw = response.read()
except (HTTPError, URLError):
raise RuntimeError("Request failed. Check account status, quota and target availability.") from None
try:
result = json.loads(raw)
except (ValueError, UnicodeDecodeError):
result = None
if isinstance(result, dict) and result.get("success") is False:
raise RuntimeError("The API returned an error. Review the official error documentation.")
return raw
if __name__ == "__main__":
Path("page.html").write_bytes(fetch_html("https://example.com/"))
print("Saved page.html. Parse it separately to extract fields or write CSV.")
Run python scrapestack_api.py. Review the response before treating it as a successful collection. The example deliberately omits private request URLs from errors, and does not log or submit your key to this guide site. No authenticated API request was made to validate the example; the endpoint and parameters are checked against the official documentation.
Common API errors: what to check first
- Authentication: check that the key exists in the environment, belongs to the correct account and has not been revoked.
- Quota or plan restrictions: inspect your dashboard and the free-plan limits before retrying or enabling additional options.
- Invalid target: confirm the URL includes its scheme and is encoded once.
- HTML without the expected data: compare the initial HTML with the page's rendered content; ask whether your task needs JavaScript rendering.
- A provider error response: read the official error reference rather than treating every response body as page HTML.
Options are not automatically included
Rendering, geolocation and premium proxy options can depend on the subscription and affect usage. Start with the two required parameters and a known target; then consult the current documentation and account limits for each optional feature. Do not assume every plan supports the same request.
From HTML to a usable CSV
After fetching, define the output fields and parse the saved HTML. Keep source URLs, validate a sample and export with a CSV library. Our CSV export guide and CSV cleaner cover those next steps.