Geonode logo
Available

TypeScript SDK integration

Build server-side JavaScript and TypeScript agents with Geonode’s typed clients. Extract pages, crawl sites, discover URLs, search the web and run batches. Feed results into your AI features and data workflows, with webhook subscriptions and usage statistics available from your code.

Version 0.6.2Node.js 18+GitHub

What You'll Need

  • Node.js 18+

  • A Geonode API key and an active plan for authenticated requests.

Get started

Build server-side JavaScript or TypeScript workflows with the Geonode Scraper API. The SDK uses Node's built-in fetch and provides typed API clients and request models.

  1. Extract your first page

    Set GEONODE_SCRAPER_API_KEY in your server environment. This ES module example uses top-level await: run it as an .mjs file, or use a TypeScript runtime configured for ES modules. Keep the key in server code.

    JAVASCRIPT / TYPESCRIPT · ES MODULE
    import {
      Configuration, ExtractionApi, OutputFormat,
    } from "@geonode_scraper/scraper-sdk";
    
    const apiKey = process.env.GEONODE_SCRAPER_API_KEY;
    if (!apiKey) throw new Error("Set GEONODE_SCRAPER_API_KEY");
    
    const configuration = new Configuration({ apiKey });
    const response = await new ExtractionApi(configuration).extractV1ExtractPost({
      extractRequest: {
        url: "https://example.com",
        formats: [OutputFormat.Markdown],
      },
    });
    
    if ("data" in response) {
      console.log(response.data.markdown);
      console.log(response.tokensCharged);
    }

    On success, data.markdown contains the extracted page and tokensCharged reports the request cost. The data check narrows the response type; background requests return a job instead.

  2. Move from one page to a workflow

    1. BatchApi submits a list of URLs; CrawlApi follows links within your depth and page limits.
    2. MapApi discovers a site's URLs, and SearchApi returns ranked search results.
    3. For background work, save jobId and inspect the terminal job status. Bound polling by a deadline and handle failures or cancellation.
    4. Use page and pageSize to retrieve all pages of batch or crawl results.
  3. Keep API access on your server

    Use the full scoped package name in imports. The SDK can run in a browser, but embedding your Geonode API key there exposes it to visitors. Call it from a backend route, worker or other server process, then return only the data your frontend needs.

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.

Example workflows

  • Add website import to your app

    Accept a URL on your server, extract its content, and return the result to your application.

  • Refresh background data

    Submit a batch or crawl, retain the job ID, and process results after completion.

Runtime and access

Runtime

Node.js 18+

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
npm install @geonode_scraper/scraper-sdk@0.6.2

Troubleshooting

  • My API key is not accepted.

    Check the key in the Geonode dashboard and send it using X-Api-Key. Keep it out of browser bundles, URLs and version control.

  • The request is rate limited.

    Respect the Retry-After response and your plan’s concurrency limits. Avoid automatically retrying a job submission when its outcome is unknown.

Related integrations

Start building with TypeScript SDK

Typed web data access for JavaScript and TypeScript agents.