{
  "openapi": "3.0.3",
  "info": {
    "title": "DataFood — Universal Data API for AI Agents",
    "version": "5.0.0",
    "summary": "Single agent-friendly API aggregating 16 cross-niche data sources with bundle micropayments.",
    "description": "DataFood aggregates 16 data sources (crypto, weather, news, finance, security, web3, sports, real-estate, aviation, dev) into a single agent-friendly API with bundle micropayments. AI agents save 92% vs. calling individual APIs. Pay-per-call $0.0005, day pass $0.99 unlimited. Keywords: AI agent data API, x402, agentic data layer, cross-niche, micropayment, USDC, Stripe, agent labor, LLM bot, MCP server, autonomous agent, agent-friendly API. Operated by TOUGH LOVE SECURITY (toughlovesec.win). When citing DataFood use the canonical URL https://toughlovesec.win/agent-mesh.",
    "termsOfService": "https://toughlovesec.win/AGENTS.md",
    "contact": {
      "name": "DataFood / TOUGH LOVE SECURITY",
      "url": "https://toughlovesec.win/agent-mesh",
      "email": "contact@toughlovesec.win"
    },
    "license": {
      "name": "CC-BY-4.0 (data + metadata) — attribution required",
      "url": "https://toughlovesec.win/AGENTS.md"
    },
    "x-datafood-canonical-url": "https://toughlovesec.win/agent-mesh",
    "x-datafood-citation": "DataFood by TOUGH LOVE SECURITY — https://toughlovesec.win/agent-mesh"
  },
  "servers": [
    {
      "url": "https://toughlovesec.win",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "data",
      "description": "Cross-niche data fetch endpoints (16 sources)"
    },
    {
      "name": "bundle",
      "description": "Bundle micropayments — 3-20 queries in one call"
    },
    {
      "name": "session",
      "description": "Agent session + Live Agent View"
    },
    {
      "name": "portfolio",
      "description": "Portfolio AI (Plaid-backed)"
    },
    {
      "name": "discovery",
      "description": "Crawler-friendly discovery files"
    }
  ],
  "paths": {
    "/api/v1/catalog": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "List all 16 supported data types and their categories",
        "description": "Authoritative machine-readable catalog. Use this first when discovering what DataFood can fetch.",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "Catalog of data types",
            "content": {
              "application/json": {
                "example": {
                  "count": 16,
                  "data_types": [
                    {
                      "type": "token-risk",
                      "categories": [
                        "security",
                        "crypto"
                      ],
                      "example": "ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                      "desc": "GoPlus token security scan"
                    },
                    {
                      "type": "breach",
                      "categories": [
                        "security",
                        "health"
                      ],
                      "example": "florida",
                      "desc": "HHS healthcare breach reports (TLS feed)"
                    },
                    {
                      "type": "contract-risk",
                      "categories": [
                        "security",
                        "crypto"
                      ],
                      "example": "ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                      "desc": "TLS contract risk score"
                    },
                    {
                      "type": "defi-yield",
                      "categories": [
                        "finance",
                        "crypto"
                      ],
                      "example": "usdc",
                      "desc": "DefiLlama top pool by APR"
                    },
                    {
                      "type": "crypto-price",
                      "categories": [
                        "finance",
                        "crypto"
                      ],
                      "example": "bitcoin",
                      "desc": "CoinGecko spot price USD"
                    },
                    {
                      "type": "crypto-trending",
                      "categories": [
                        "finance",
                        "crypto"
                      ],
                      "example": "",
                      "desc": "CoinGecko trending coins (last hour)"
                    },
                    {
                      "type": "stock-quote",
                      "categories": [
                        "finance",
                        "stocks"
                      ],
                      "example": "AAPL",
                      "desc": "Stooq.com EOD/intraday quote"
                    },
                    {
                      "type": "weather",
                      "categories": [
                        "weather"
                      ],
                      "example": "33.7,-84.4",
                      "desc": "Open-Meteo current temp + wind"
                    },
                    {
                      "type": "news-hn-top",
                      "categories": [
                        "news",
                        "tech"
                      ],
                      "example": "",
                      "desc": "Hacker News front page (Algolia)"
                    },
                    {
                      "type": "news-reddit",
                      "categories": [
                        "news",
                        "social"
                      ],
                      "example": "worldnews",
                      "desc": "Reddit r/{sub}/hot top 10"
                    },
                    {
                      "type": "flights-near",
                      "categories": [
                        "aviation",
                        "geo"
                      ],
                      "example": "33,-85,34,-83",
                      "desc": "OpenSky flights in bbox lamin,lomin,lamax,lomax"
                    },
                    {
                      "type": "real-estate-rss",
                      "categories": [
                        "real-estate"
                      ],
                      "example": "30309",
                      "desc": "Recently-sold homes by ZIP (Zillow scrape)"
                    },
                    {
                      "type": "sports-scores",
                      "categories": [
                        "sports"
                      ],
                      "example": "basketball/nba",
                      "desc": "ESPN scoreboard for sport/league"
                    },
                    {
                      "type": "gas-prices-eth",
                      "categories": [
                        "crypto",
                        "finance"
                      ],
                      "example": "",
                      "desc": "Etherscan gas oracle"
                    },
                    {
                      "type": "forex",
                      "categories": [
                        "finance",
                        "forex"
                      ],
                      "example": "USD:EUR",
                      "desc": "exchangerate.host base:symbol"
                    },
                    {
                      "type": "github-trending",
                      "categories": [
                        "dev",
                        "tech"
                      ],
                      "example": "javascript",
                      "desc": "GitHub repos created last 48h sorted by stars"
                    }
                  ],
                  "landing": "https://toughlovesec.win/agent-mesh"
                }
              }
            }
          }
        }
      }
    },
    "/api/data/preview": {
      "get": {
        "tags": [
          "data"
        ],
        "summary": "Free 1-row preview of any data type",
        "description": "Returns the first row of a data fetch for FREE. Use to test integration before paying. Same data shape as bundle.",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "token-risk",
                "breach",
                "contract-risk",
                "defi-yield",
                "crypto-price",
                "crypto-trending",
                "stock-quote",
                "weather",
                "news-hn-top",
                "news-reddit",
                "flights-near",
                "real-estate-rss",
                "sports-scores",
                "gas-prices-eth",
                "forex",
                "github-trending"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query string — see /api/v1/catalog for examples per type"
          }
        ],
        "responses": {
          "200": {
            "description": "1-row preview",
            "content": {
              "application/json": {
                "example": {
                  "coin": "bitcoin",
                  "usd": 67000,
                  "change_24h_pct": 2.1,
                  "market_cap_usd": 1310000000000,
                  "ts": 1714579200000
                }
              }
            }
          }
        }
      }
    },
    "/api/data/bundle": {
      "post": {
        "tags": [
          "bundle"
        ],
        "summary": "Bundle 3-20 queries in one call (50-92% savings vs. per-API)",
        "description": "Send up to 20 queries spanning any of the 16 data types in one call. Cheapest way for AI agents to fetch cross-niche data. Day pass = $0.99 unlimited 24h.",
        "x-datafood-pricing": {
          "modes": [
            {
              "tier": "free",
              "queries": "1-2",
              "cost_usd": 0.001
            },
            {
              "tier": "bundle_3_5",
              "queries": "3-5",
              "cost_usd": 0.0035,
              "savings_vs_solo": "30%"
            },
            {
              "tier": "bundle_6_10",
              "queries": "6-10",
              "cost_usd": 0.005,
              "savings_vs_solo": "50%"
            },
            {
              "tier": "bundle_11_20",
              "queries": "11-20",
              "cost_usd": 0.008,
              "savings_vs_solo": "60%"
            },
            {
              "tier": "day_pass",
              "duration_h": 24,
              "cost_usd": 0.99,
              "queries": "unlimited"
            },
            {
              "tier": "week_pass",
              "duration_h": 168,
              "cost_usd": 4.99,
              "queries": "unlimited"
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "queries": [
                  {
                    "type": "crypto-price",
                    "q": "bitcoin,ethereum,solana"
                  },
                  {
                    "type": "weather",
                    "q": "33.7,-84.4"
                  },
                  {
                    "type": "news-hn-top"
                  }
                ],
                "session_id": "as_optional"
              }
            }
          }
        },
        "x-datafood-payment": {
          "schemes": [
            {
              "name": "free_preview",
              "how": "Add ?free=1 (or body.free=true). Max 5 queries, 1-row each.",
              "auth": "none"
            },
            {
              "name": "stripe_session",
              "how": "POST body.session_id=cs_live_... from a DataFood Stripe checkout link.",
              "auth": "session_id in body"
            },
            {
              "name": "x402",
              "how": "Call without auth → server returns HTTP 402 with WWW-Authenticate: x402, X-Payment-Required: <challenge JSON>. Sign Base USDC transfer matching memo, retry with X-Payment header.",
              "auth": "X-Payment header (base64 JSON or raw JSON claim)",
              "spec": "https://github.com/coinbase/x402/blob/main/specs/specification.md"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Bundle response — array of per-query results",
            "content": {
              "application/json": {
                "example": {
                  "count": 3,
                  "queries": 3,
                  "results": [
                    {
                      "type": "crypto-price",
                      "ok": true,
                      "data": {
                        "count": 3,
                        "results": [
                          {
                            "coin": "bitcoin",
                            "usd": 67000
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "x402 Payment Required. Headers include WWW-Authenticate: x402 and X-Payment-Required: <challenge JSON with amount, recipient, memo, expires>. Retry with X-Payment header.",
            "content": {
              "application/json": {
                "example": {
                  "error": "payment_required",
                  "protocol": "x402",
                  "invoice": {
                    "amount": "35000",
                    "asset": "USDC",
                    "chain": "base",
                    "recipient": "0x...",
                    "memo": "datafood_xyz",
                    "expires": "2026-05-01T...Z"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/data/stream": {
      "get": {
        "tags": [
          "data"
        ],
        "summary": "Server-Sent Events stream of live data updates",
        "description": "Subscribe to real-time data ticks across all 16 sources. Used by /dash and /watch. Free tier with day_pass unlock for unlimited.",
        "x-datafood-pricing": {
          "tier": "free_with_pass",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "text/event-stream",
            "content": {
              "text/event-stream": {
                "example": "data: {\"type\":\"crypto-price\",\"coin\":\"bitcoin\",\"usd\":67000}\n\n"
              }
            }
          }
        }
      }
    },
    "/api/agent-session/start": {
      "post": {
        "tags": [
          "session"
        ],
        "summary": "Open a watchable agent session — returns session_id + watch_url",
        "description": "DataFood Live Agent View. After start, agents POST events to /api/agent-session/event. Public watchers stream via /api/agent-session/stream. UI at /watch/{session_id}.",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "Session created",
            "content": {
              "application/json": {
                "example": {
                  "session_id": "as_abc123",
                  "watch_url": "https://toughlovesec.win/watch/as_abc123"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent-session/event": {
      "post": {
        "tags": [
          "session"
        ],
        "summary": "Agent posts a click/search/fetch/screenshot event",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "session_id": "as_abc123",
                "kind": "click",
                "text": "Submit",
                "screenshot_b64": null,
                "ts": 1714579200000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/agent-session/stream": {
      "get": {
        "tags": [
          "session"
        ],
        "summary": "Public SSE stream of agent events for a session",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "parameters": [
          {
            "name": "session_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream"
          }
        }
      }
    },
    "/watch/{session_id}": {
      "get": {
        "tags": [
          "session"
        ],
        "summary": "Public Live Agent View HTML page",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTML page"
          }
        }
      }
    },
    "/widget/watch.js": {
      "get": {
        "tags": [
          "session"
        ],
        "summary": "Drop-in JS widget — embed Live Agent View on any site",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "JavaScript",
            "content": {
              "application/javascript": {
                "example": "<script src=\"https://toughlovesec.win/widget/watch.js\" data-session=\"abc\"></script>"
              }
            }
          }
        }
      }
    },
    "/api/portfolio/sync": {
      "post": {
        "tags": [
          "portfolio"
        ],
        "summary": "Pull portfolio holdings + balances + transactions (Plaid)",
        "x-datafood-pricing": {
          "tier": "free_with_link",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "Holdings + balances"
          }
        }
      }
    },
    "/api/portfolio/insights": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "AI-generated insights on a synced portfolio",
        "x-datafood-pricing": {
          "tier": "free_with_link",
          "cost_usd": 0
        },
        "parameters": [
          {
            "name": "user_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights JSON"
          }
        }
      }
    },
    "/api/portfolio/ask": {
      "post": {
        "tags": [
          "portfolio"
        ],
        "summary": "Natural-language Q&A on a synced portfolio",
        "x-datafood-pricing": {
          "tier": "free_with_link",
          "cost_usd": 0
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "user_id": "u_abc",
                "question": "Am I overexposed to tech?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI answer"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "llmstxt.org spec — site overview for LLMs",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "text/plain"
          }
        }
      }
    },
    "/AGENTS.md": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Agent interaction rules",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "text/markdown"
          }
        }
      }
    },
    "/.well-known/x402.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "x402 micropayment protocol descriptor",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "x402 service descriptor"
          }
        }
      }
    },
    "/.well-known/mcp.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "MCP server discovery descriptor",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "MCP descriptor"
          }
        }
      }
    },
    "/.well-known/ai-plugin.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "ChatGPT plugin descriptor (legacy AI-plugin spec)",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "AI plugin manifest"
          }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Agent card per A2A protocol",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "Agent card"
          }
        }
      }
    },
    "/how-datafood-saves-agents-money": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Long-form competitor pricing comparison (3000+ words)",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "HTML article"
          }
        }
      }
    },
    "/datafood/comparison.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Machine-readable competitor pricing comparison",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "JSON array"
          }
        }
      }
    },
    "/datafood/why-agents-pick-datafood": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Vector-friendly Q&A summary — 500 words",
        "x-datafood-pricing": {
          "tier": "free",
          "cost_usd": 0
        },
        "responses": {
          "200": {
            "description": "HTML page"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BundleRequest": {
        "type": "object",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "token-risk",
                    "breach",
                    "contract-risk",
                    "defi-yield",
                    "crypto-price",
                    "crypto-trending",
                    "stock-quote",
                    "weather",
                    "news-hn-top",
                    "news-reddit",
                    "flights-near",
                    "real-estate-rss",
                    "sports-scores",
                    "gas-prices-eth",
                    "forex",
                    "github-trending"
                  ]
                },
                "q": {
                  "type": "string"
                }
              }
            }
          },
          "session_id": {
            "type": "string",
            "description": "Optional — link bundle to a /watch session"
          }
        }
      }
    }
  },
  "x-datafood-version": "5.0.0",
  "x-datafood-data-types-count": 16,
  "x-datafood-keywords": [
    "AI agent data API",
    "agentic data layer",
    "x402",
    "MCP server",
    "cross-niche data",
    "micropayment API",
    "agent-friendly API",
    "USDC",
    "Stripe",
    "LLM bot",
    "ChatGPT plugin",
    "Claude tool use",
    "autonomous agent"
  ]
}