Geonode logo
Available

Use Geonode Scraper with Python SDK

Turn web pages into Markdown with typed Python requests. Extract, batch, crawl, map and search from one client.

Version 0.6.2Python 3.10+GitHub

What You'll Need

  • Python environment

    Use a virtual environment and install geonode-scraper-sdk.

  • Geonode API key

    Copy your Scraper API key from the dashboard.

  • Production host

    Set the host to https://scraper.geonode.io.

Your first extraction

Install geonode-scraper-sdk, set GEONODE_SCRAPER_API_KEY, then run this example.

import os
from geonode_scraper_sdk import (
    ApiClient, Configuration, ExtractionApi,
    ExtractRequest, OutputFormat, ProcessingMode,
)

config = Configuration(
    host="https://scraper.geonode.io",
    api_key={"ApiKeyAuth":
        os.environ["GEONODE_SCRAPER_API_KEY"]},
)
with ApiClient(config) as client:
    result = ExtractionApi(client).extract_v1_extract_post(
        ExtractRequest(
            url="https://example.com",
            formats=[OutputFormat.MARKDOWN],
        )
    )
    print(result.data.markdown)

Configure your request

Choose the output and execution mode that fit your pipeline.

  • Typed request models

    Use SDK models and enums to build requests.

    ExtractRequest(
      url="https://example.com",
      formats=[OutputFormat.MARKDOWN]
    )
  • Sync or async

    Extract one page now, or retrieve a job later.

    processing_mode=ProcessingMode.ASYNC
  • Dynamic pages

    Enable rendering when content depends on JavaScript.

    render_js=True

Developer documentation

Get the full setup guide, authentication details and technical reference.

Read the developer docs

Capabilities

  • Extract page content as Markdown or HTML, with optional JavaScript rendering.

  • Run batch extraction and bounded website crawls as background jobs.

  • Discover website URLs before choosing which pages to extract.

  • Search the web, receive job notifications through webhooks and inspect API usage.

Common workflows

# Reuse config from the quick start
from geonode_scraper_sdk import (
    ApiClient, BatchApi, BatchRequest,
    OutputFormat,
)

with ApiClient(config) as client:
    job = BatchApi(client).create_batch_v1_batch_post(
        BatchRequest(
            urls=[
                "https://example.com/a",
                "https://example.com/b",
            ],
            formats=[OutputFormat.MARKDOWN],
        )
    )
    print(job.job_id)

Runtime and access

Runtime

Python 3.10+

Account and access

Keep API keys on the server or in your client’s credential store. Usage is charged to your Geonode plan.

Installation

Shell
pip install geonode-scraper-sdk==0.6.2

Troubleshooting

  • Cannot connect

    Check that the host is the production URL, not localhost.

  • Invalid API key

    Check ApiKeyAuth and the key in your environment.

  • Missing Markdown

    Request Markdown explicitly and inspect the returned data.

  • Job still running

    Keep the job ID and fetch its status before reading results.

Build a dependable workflow

  • Use a virtual environment

    Keep package dependencies scoped to your project.

  • Keep keys server-side

    Read credentials from environment variables.

  • Inspect job status

    Handle completed, failed and cancelled jobs.

  • Check your usage

    Use the usage and statistics endpoints.

FAQ

No. The SDK exposes typed clients for the public Scraper API endpoints: Extraction, Batch, Crawl, Map, Search, Usage, Statistics and Webhooks each have their own API class.

Markdown and HTML. Pass formats=[OutputFormat.MARKDOWN], [OutputFormat.HTML] or both. Extract returns HTML by default, so request Markdown explicitly when you need it.

Yes. Set processing_mode=ProcessingMode.ASYNC to get a job_id right away, then fetch the result with get_job_result_v1_extract_job_id_get. Batch and Crawl always run as jobs, and webhooks can notify you when a job finishes.

Yes. BatchApi accepts 1 to 1,000 URLs in one job. To collect a whole site, start a crawl from a seed URL with CrawlApi, or discover URLs with MapApi first.

Related integrations

Build your next Python data pipeline.

Get a Scraper API key and start with one page.