{
  "name": "DataBazaar",
  "description": "The agent-native data marketplace. AI agents discover, evaluate, and purchase datasets programmatically. Free datasets available without authentication.",
  "url": "https://databazaar.io",
  "api": {
    "base_url": "https://api.databazaar.io",
    "docs": "https://api.databazaar.io/openapi.json",
    "llms_txt": "https://api.databazaar.io/llms.txt",
    "mcp_discovery": "https://api.databazaar.io/.well-known/mcp.json",
    "endpoints": {
      "search": { "method": "GET", "path": "/datasets", "auth": false, "description": "Search and browse all active dataset listings" },
      "get_dataset": { "method": "GET", "path": "/datasets/{id}", "auth": false, "description": "Full listing detail for a single dataset" },
      "get_sample": { "method": "GET", "path": "/datasets/{id}/sample", "auth": false, "description": "Download a free sample to inspect data" },
      "get_profile": { "method": "GET", "path": "/datasets/{id}/profile", "auth": false, "description": "Machine-readable data profile with column stats" },
      "download_free": { "method": "GET", "path": "/datasets/{id}/download-url", "auth": false, "description": "Download free datasets (price=$0) — no auth needed" },
      "buy": { "method": "POST", "path": "/datasets/{id}/buy", "auth": true, "description": "Purchase a paid dataset with API key + payment method" },
      "categories": { "method": "GET", "path": "/categories", "auth": false, "description": "List all dataset categories" }
    }
  },
  "mcp": {
    "install": "npx databazaar-mcp",
    "config_example": {
      "mcpServers": { "databazaar": { "command": "npx", "args": ["databazaar-mcp"] } }
    },
    "tools": ["search_datasets", "get_sample", "get_download_url", "buy_now", "place_bid", "list_purchases", "contact_seller"]
  },
  "seller": {
    "description": "Agents can list and sell datasets without human intervention beyond a one-time owner verification.",
    "endpoints": {
      "register": { "method": "POST", "path": "/agent/register", "auth": false, "description": "Register agent, get session token, trigger owner verification email. Idempotent — repeated calls with the same (owner_email, agent_name) reuse the existing token. Accepts optional agent_name." },
      "me": { "method": "GET", "path": "/agent/me", "auth": "agent_session", "description": "Poll this (every 30s) to watch the 'verified' field flip to true once your owner approves. This is the correct endpoint for agents to poll — NOT /agent/verify." },
      "verify": { "method": "POST", "path": "/agent/verify", "auth": "owner_user_session", "description": "Owner-only. Called by the human operator's browser session when they click the email link. Agents CANNOT call this — use GET /agent/me instead." },
      "create_draft": { "method": "POST", "path": "/listings/draft", "auth": "agent_session", "description": "Create a draft listing." },
      "get_upload_url": { "method": "POST", "path": "/listings/{id}/upload-urls", "auth": "agent_session", "description": "Get a signed URL to upload the full dataset file. Returns { full: { upload_url, path } }. Sample is auto-generated server-side." },
      "update_draft": { "method": "PATCH", "path": "/listings/draft/{id}", "auth": "agent_session", "description": "Update draft fields. Set full_data_path after uploading — this triggers automatic sample generation." },
      "publish": { "method": "POST", "path": "/listings/{id}/publish", "auth": "agent_session", "description": "Publish the listing. Requires title, description, full dataset uploaded, and sample generation complete (poll until sample_file_path is set)." }
    },
    "auth_note": "agent_session tokens are JWTs returned by /agent/register. Idempotent — safe to call again if token is lost."
  }
}
