View .md

Introduction

XDive is an HTTP API that turns web pages into data your code and AI agents can use. It fetches a page as Markdown, HTML or structured JSON, crawls whole sites, searches the web, and answers questions with cited sources. Use it directly over HTTP or through the official SDKs for Python, JavaScript, Go, Java, .NET, PHP, Ruby and Rust.

What the API does

CapabilityEndpointWhat it does
ScrapePOST /orgs/{id}/scrapeOne page as Markdown, HTML, links, text, a screenshot or JSON, returned in the same request.
CrawlPOST /orgs/{id}/crawlFollows a site's links in the background; poll for status or receive webhooks.
Batch scrapePOST /orgs/{id}/batch/scrapeUp to 100 URLs as one background job.
MapPOST /orgs/{id}/mapA site's URLs from its sitemaps and links, without fetching content.
SearchPOST /orgs/{id}/searchWeb, news and image search, optionally with page content and a cited answer.
ResearchPOST /orgs/{id}/researchAnswers a question from the web with verified citations.
ExtractPOST /orgs/{id}/extractStructured data from up to 10 URLs, driven by a prompt or a JSON Schema.
llms.txtPOST /orgs/{id}/llmstxtGenerates llms.txt and llms-full.txt for a site.
MCPPOST /mcpThe same tools for AI assistants such as Claude, ChatGPT and Cursor.

Base URL

text
https://xdive.dev/api

A self-hosted server uses its own origin, for example https://your-host/api (see Self-hosting). Requests and responses are JSON; send Content-Type: application/json with a request body. The API is described in OpenAPI 3.1 at /openapi.json, and these docs are available to AI agents as Markdown through /llms.txt (see For AI agents).

How requests are organized

Every account belongs to one or more organizations, and usage, quotas and API keys belong to an organization. Endpoints that do work are scoped to one, so their paths start with /orgs/{id}/, where {id} looks like org_8f2c41d09a7b4e6f93d0c5a1b2e47f18.

An API key belongs to exactly one organization. GET /whoami tells you which one, so you only need to configure the key: the SDKs call /whoami once, cache the orgId and build every path from it. A key sent to another organization's path is rejected with 401. See Authentication.

Scrape, map, search, research, extract and llms.txt answer within the request. Crawl and batch scrape return 202 Accepted with a job id at once and run on background workers.

A first request

Create a key in the dashboard under API Keys (the Quickstart walks through it), export it as XDIVE_API_KEY, then scrape a page:

bash
# Look up the key's organization once (uses jq), then scrape.
ORG_ID=$(curl -s https://xdive.dev/api/whoami \
  -H "X-API-Key: $XDIVE_API_KEY" | jq -r .orgId)
 
curl -X POST "https://xdive.dev/api/orgs/$ORG_ID/scrape" \
  -H "X-API-Key: $XDIVE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Pick your path