Advanced APIs

Map & Crawl

Map discovers the URLs on a site and classifies them. Crawl reads many pages and returns their content.

Map

Map explores a site from a seed URL and returns discovered links with a page type and priority score. It responds synchronously when limit is 50 or fewer, otherwise it returns a job to poll.

POST/map
Request
curl https://api.ohsee.tech/map \
  -H "Authorization: Bearer ohsee-<your-key>" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com", "limit": 50 }'
200 OK (limit <= 50)
{
  "request_id": "1a2b3c4d",
  "status": "succeeded",
  "credits_charged": 5,
  "response_time": 2.30,
  "url": "https://example.com",
  "urls": [
    { "url": "https://example.com/pricing", "title": "Pricing", "path": "/pricing", "page_type": "pricing", "priority_score": 0.9 }
  ],
  "count": 1
}

Map parameters

FieldTypeDefaultDescription
urlrequiredstring-Seed URL to map from.
limitint50Maximum URLs to discover (1 to 500).
max_depthint2How many link levels to follow (0 to 5).
include_patternsstring[][]Only keep URLs matching these regex patterns.
exclude_patternsstring[][]Drop URLs matching these regex patterns.

Crawl

Crawl reads many pages starting from a seed URL and returns cleaned content per page. It is always asynchronous and returns a job_id. Pass a schema to structure each page.

POST/crawl
Request
curl https://api.ohsee.tech/crawl \
  -H "Authorization: Bearer ohsee-<your-key>" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/docs", "limit": 20, "format": "markdown" }'
GET /jobs/{id}
{
  "job_id": "c1d2e3f4-...",
  "kind": "crawl",
  "status": "succeeded",
  "credits": { "reserved": 20, "charged": 12, "refunded": 8 },
  "result": {
    "url": "https://example.com/docs",
    "pages_extracted": 12,
    "failed_pages": [],
    "pages": [{ "url": "https://example.com/docs/intro", "content": "# Intro ..." }]
  }
}
FieldTypeDescription
result.pages_extractedintNumber of pages successfully read.
result.failed_pagesobject[]Pages that failed, with an error.
result.pagesobject[]Per page: url, content, and structured when a schema is used.

Crawl parameters

FieldTypeDefaultDescription
urlrequiredstring-Seed URL to crawl from.
limitint20Maximum pages to read (1 to 200).
max_depthint2How many link levels to follow (0 to 5).
formatstringmarkdownPage format: markdown or text.
schemaobjectnullStructure each page against this schema.
include_patternsstring[][]Only crawl URLs matching these patterns.
exclude_patternsstring[][]Skip URLs matching these patterns.

Credits

Map costs 1 credit per 10 URLs found (rounded up). Crawl costs 1 credit per 5 pages (rounded up), or 1 credit per page when a schema is provided. You are charged for pages actually read.

Use small limits first and /estimate to size larger crawls.