Skip to main content
GET
Data API

Overview

NanoGPT exposes a unified Data API under /api/v1/data. It gives customers one discoverable entry point for web search, URL scraping, maps data, social data, and business enrichment. The Data API is a wrapper around the existing direct endpoints. It does not change the underlying response bodies, validation rules, billing, rate limits, async behavior, provider options, authentication, or x402 behavior unless noted here. Direct endpoints remain available for compatibility.

Base URL

Local development:

Authentication

Use the same NanoGPT API key authentication as existing API routes:
The public accountless x402 contract is available on selected Data API paths. To request an accountless x402 quote, send the API request without Authorization or x-api-key, and include x-x402: true. NanoGPT will return 402 Payment Required with available payment options. An unauthenticated request without x-x402: true is treated as a normal unauthenticated request and returns 401 missing_api_key. Currently documented accountless Data API paths:
  • POST /api/v1/data/web/search
  • POST /api/v1/data/url/scrape
Use GET /api/v1/x402/endpoints as the deployment source of truth, including Lightning L402 availability when advertised. See Accountless x402 API Payments for completion, replay, and polling behavior. Direct legacy routes remain available, but accountless docs prefer the public v1 data paths. Some underlying endpoints may also support browser-session flows. The Data API forwards authentication and payment-related headers to the underlying route.

Discovery

List available Data API endpoints:
Alias:
The catalog response is cacheable:

Example catalog response

Endpoint Metadata

For endpoints that do not support GET, calling their Data API path with GET returns the public metadata object instead of dispatching the tool.
For endpoints that do support GET, the request is forwarded to the underlying endpoint.

Calling Endpoints

The Data API supports path-style dispatch and body-style dispatch.

Path-style dispatch

Use a stable Data API path and send the underlying endpoint’s normal input body.
Path-style dispatch is the simplest format for fixed integrations because each tool has a URL.

Body-style dispatch

Use POST /api/v1/data and specify the target endpoint in the request body.
The dispatch key can be endpoint, id, or type. Endpoint input can be provided in an input object:
It can also be provided directly in the dispatch body:
If input is present, it is forwarded. If data is present and input is absent, data is forwarded. Otherwise, all fields except endpoint, id, type, input, and data are forwarded as the endpoint input.

Request Forwarding Behavior

The Data API:
  • Preserves request query parameters.
  • Preserves request headers except hop-by-hop headers such as connection, content-length, host, keep-alive, transfer-encoding, and upgrade.
  • Forces Content-Type: application/json when it forwards a JSON body.
  • Forwards JSON request bodies to POST routes.
  • Allows empty-body path-style POST requests and forwards {}.
  • Requires a valid JSON body for body-style POST /api/v1/data.
  • Adds tracking headers to dispatched responses.

Response Headers

Dispatched responses include:
These headers are exposed to browser clients through:
Use these headers for client-side observability, debugging, analytics, and support traces.

Error Format

Errors generated by the Data API wrapper use this shape:
Common wrapper-level errors: Once a request is forwarded, the underlying endpoint may return its own existing error format.

Endpoint Catalog

Endpoint Aliases

Body-style dispatch accepts canonical endpoint IDs and these aliases: The resolver also normalizes endpoint IDs by trimming slashes, accepting api/v1/data/...-style strings, converting path slashes to dots, and converting hyphens to underscores.

X/Twitter Subpaths

x.read is special. The catalog lists the base X endpoint:
The dispatcher also supports dynamic X subpaths and forwards them to /api/v1/x/.... Examples:
For path-style POST requests with no body, the wrapper forwards {} and preserves the query string. This supports query-only X calls.

Examples

Body-style dispatch:

Scrape URLs

Accountless x402 Data Request

Both examples return 402 Payment Required with a payment object when accountless x402 is enabled and the request can be quoted. If you receive 401 missing_api_key immediately, check that the initial quote request includes x-x402: true. Without that header, NanoGPT does not enter the x402 quote flow.
Google Maps search also supports GET for the same behavior exposed by the direct /api/v1/googlemaps endpoint, including polling async runs when applicable.
Body-style dispatch:

X Search With Query Parameters

Path-style POST also works for query-only X calls: