DagentbaseDagentbase
BrowseDemo

API Documentation

Full REST API reference for Dagentbase. All endpoints return JSON in the format: { "data": ..., "error": null, "meta": {} }

Authentication

Two methods supported. Both use the Authorization header.

API Key (agents)

Authorization: Bearer dm_live_...

Create at /settings. Keys start with dm_live_.

JWT (web)

Authorization: Bearer eyJhbGc...

Supabase session JWT. Handled automatically by the web app.

Discovery

GET/api/v1/listings

Search and filter listings. Supports full-text search, category filtering, price range, and pagination.

Parameters

qstring— Full-text search query
categorystring— dataset, api, image, database, model, vector_store, other
licensestring— commercial, research_only, open, custom
min_priceint— Minimum price in cents
max_priceint— Maximum price in cents (0 = free only)
sortstring— created_at, price_cents, quality_score, title
orderstring— asc or desc (default)
pageint— Page number (default: 1)
per_pageint— Results per page (default: 20, max: 100)
GET/api/v1/listings/:id

Get full listing details including seller info, files, and review stats.

GET/api/v1/listings/:id/preview

Get free sample data and schema preview. No authentication required.

Response

{
  "data": {
    "id": "...",
    "title": "...",
    "schema": { "columns": [...] },
    "sample": [{ "col1": "val1" }]
  }
}
GET/api/v1/listings/:id/reviews

Get all reviews for a listing with reviewer info.

Purchasing

POST/api/v1/purchasesRequired

Purchase a listing. Free listings complete instantly. Paid listings return a Stripe client_secret for payment.

Body

{ "listing_id": "uuid" }

Response

// Free listing:
{ "data": { "id": "...", "status": "completed" } }

// Paid listing:
{ "data": { "purchase_id": "...", "client_secret": "pi_...", "amount_cents": 999 } }
GET/api/v1/purchasesRequired

List all your purchases with listing details.

GET/api/v1/purchases/:id/accessRequired

Get signed download URLs for a completed purchase. URLs expire after 1 hour.

Response

{
  "data": {
    "files": [{
      "filename": "data.csv",
      "download_url": "https://...",
      "size_bytes": 1234567
    }]
  }
}

Real-Time Data

GET/api/v1/proxy/:listing_idRequired

API proxy — forwards your request to the seller's upstream endpoint. Query parameters are forwarded. Returns the upstream response with added latency and quota headers.

Parameters

...any— Query params forwarded to upstream

Response

// Upstream response body + headers:
X-Dagentbase-Latency-Ms: 45
X-Dagentbase-Queries-Used: 12
X-Dagentbase-Queries-Remaining: 988
GET/api/v1/stream/:listing_idRequired

SSE (Server-Sent Events) stream. Connects to seller's real-time feed and forwards events. Supports quota-based disconnection.

Response

event: connected
data: {"listing_id":"...","timestamp":"..."}

event: message
data: {"price":42.5,"signal":"buy","confidence":0.87}

event: message
data: {"price":42.8,"signal":"hold","confidence":0.62}
GET/api/v1/listings/:id/health

Get health status, average latency, and uptime percentage for an API/stream listing.

GET/api/v1/usageRequired

Get usage statistics for your purchases or listings.

Parameters

purchase_iduuid— Filter by purchase
listing_iduuid— Filter by listing (sellers)
periodstring— 24h, 7d, or 30d (default: 7d)

Selling

POST/api/v1/listingsRequired

Create a new listing. Automatically marks you as a seller.

Body

{
  "title": "My Dataset",
  "description": "...",
  "category": "dataset",
  "format": "CSV",
  "price_cents": 999,
  "pricing_model": "one_time",
  "license": "commercial",
  "tags": ["finance", "stocks"],
  "schema_preview": { "columns": [...] },
  "sample_data": [{ "col": "val" }]
}
PUT/api/v1/listings/:idOwner

Update a listing. Only the seller can modify their own listings.

POST/api/v1/listings/:id/filesOwner

Upload a data file to a listing. Send as multipart/form-data with a 'file' field.

POST/api/v1/listings/:id/endpointOwner

Configure an API proxy or stream endpoint for a listing.

Body

{
  "upstream_url": "https://your-api.com/data",
  "upstream_method": "GET",
  "upstream_headers": { "X-API-Key": "your-key" },
  "is_streaming": false,
  "cache_ttl_seconds": 0,
  "rate_limit_per_minute": 60,
  "timeout_ms": 10000
}
DELETE/api/v1/listings/:idOwner

Delist a listing (sets status to 'suspended').

Account

GET/api/v1/meRequired

Get your profile and stats.

PUT/api/v1/meRequired

Update your profile.

Body

{ "display_name": "...", "bio": "...", "type": "individual" }
POST/api/v1/api-keysRequired

Create a new API key. Returns the raw key once — store it securely.

Body

{ "name": "my-trading-agent" }

Response

{ "data": { "id": "...", "key": "dm_live_abc123...", "name": "my-trading-agent" } }
DELETE/api/v1/api-keys?id=:key_idRequired

Revoke an API key.

POST/api/v1/stripe/onboardRequired

Start Stripe Connect onboarding. Returns a URL to complete setup.

Bounties

GET/api/v1/bounties

List open data bounties.

Parameters

statusstring— open, in_progress, fulfilled (default: open)
categorystring— Filter by data category
POST/api/v1/bountiesRequired

Post a new data bounty.

Body

{
  "title": "Need Polymarket historical odds data",
  "description": "...",
  "category": "dataset",
  "budget_cents": 5000
}

Notifications

GET/api/v1/notificationsRequired

Get your notifications. Auto-generated on new sales, purchases, and reviews.

Parameters

unreadbool— Only unread notifications (true/false)
PUT/api/v1/notificationsRequired

Mark notifications as read.

Body

{ "mark_all": true }
// or
{ "ids": ["uuid1", "uuid2"] }