{
  "openapi": "3.1.0",
  "info": {
    "title": "agentshop",
    "version": "2.0.0",
    "description": "Machine-to-machine macroeconomic report store: 61 catalog reports plus bespoke and bundle products, generated from World Bank Open Data (CC BY 4.0) and sold per fetch in USDC over x402.",
    "keywords": [
      "macroeconomic data",
      "world bank data",
      "cross-country comparison",
      "economic indicators",
      "time series data",
      "gdp",
      "inflation",
      "trade",
      "external debt",
      "foreign direct investment",
      "labour market",
      "demographics",
      "energy",
      "co2 emissions",
      "esg",
      "health expenditure",
      "military expenditure",
      "digital adoption",
      "fiscal policy",
      "research and development",
      "country risk",
      "sovereign analysis",
      "market research data",
      "dataset api",
      "tariffs",
      "trade policy",
      "population ageing",
      "renewable electricity",
      "high-technology exports",
      "scientific research output",
      "poverty",
      "inequality",
      "fiscal space",
      "correlation matrix"
    ],
    "contact": {
      "name": "agentshop",
      "url": "https://x402-report-store.app.workbuddy.host"
    },
    "license": {
      "name": "Report content: generated from World Bank Open Data (CC BY 4.0)",
      "url": "https://data.worldbank.org"
    }
  },
  "servers": [
    {
      "url": "https://x402-report-store.app.workbuddy.host"
    }
  ],
  "paths": {
    "/report/{id}": {
      "get": {
        "operationId": "getReport",
        "summary": "Fetch one catalog report by id",
        "tags": [
          "paid",
          "report"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "macro-gdp",
                "macro-gdp-per-capita",
                "macro-gdp-ppp",
                "macro-gdp-growth",
                "macro-inflation",
                "macro-gdp-deflator",
                "macro-fx",
                "macro-trade",
                "macro-imports",
                "macro-trade-openness",
                "macro-current-account",
                "macro-remittances",
                "macro-fdi",
                "macro-debt",
                "macro-credit",
                "macro-market-cap",
                "macro-population",
                "macro-population-growth",
                "macro-life-expectancy",
                "macro-unemployment",
                "macro-labor-force",
                "macro-gini",
                "macro-economic-structure",
                "macro-fiscal",
                "macro-rnd",
                "macro-patents",
                "macro-energy",
                "macro-co2",
                "macro-air-quality",
                "macro-food",
                "macro-health",
                "macro-military",
                "macro-digital",
                "macro-real-gdp",
                "macro-gni-per-capita",
                "macro-tech-exports",
                "macro-scientific-output",
                "macro-tertiary-education",
                "macro-broadband",
                "macro-internet-security",
                "macro-renewable-power",
                "macro-fossil-share",
                "macro-electricity-access",
                "macro-tariffs",
                "macro-tourism",
                "macro-debt-interest",
                "macro-population-aging",
                "macro-poverty",
                "macro-gender-parliament",
                "macro-forest",
                "macro-undernourishment",
                "macro-hospital-beds",
                "macro-military-spend",
                "theme-growth-quality",
                "theme-energy-transition",
                "theme-tech-capability",
                "theme-fiscal-space",
                "theme-demographic-shift",
                "theme-trade-exposure",
                "theme-human-capital",
                "theme-inclusion-poverty"
              ]
            },
            "description": "Report id. See /catalog for descriptions, prices, coverage and data-point counts."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "json",
                "csv",
                "summary-csv"
              ],
              "default": "html"
            },
            "description": "Delivery format. html is the analytical document; json is the full structured payload; csv is a tidy long panel (one row per observation); summary-csv is one row per economy of derived metrics. An Accept header of application/json or text/csv is honoured when this is omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "The report in the requested format",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPayload"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported ?format= value; the response lists the supported set"
          },
          "402": {
            "description": "Payment required (x402 challenge)"
          },
          "404": {
            "description": "Unknown report id"
          }
        },
        "x-x402": [
          {
            "id": "macro-gdp",
            "price": "$0.13"
          },
          {
            "id": "macro-gdp-per-capita",
            "price": "$0.13"
          },
          {
            "id": "macro-gdp-ppp",
            "price": "$0.13"
          },
          {
            "id": "macro-gdp-growth",
            "price": "$0.13"
          },
          {
            "id": "macro-inflation",
            "price": "$0.13"
          },
          {
            "id": "macro-gdp-deflator",
            "price": "$0.09"
          },
          {
            "id": "macro-fx",
            "price": "$0.13"
          },
          {
            "id": "macro-trade",
            "price": "$0.13"
          },
          {
            "id": "macro-imports",
            "price": "$0.13"
          },
          {
            "id": "macro-trade-openness",
            "price": "$0.13"
          },
          {
            "id": "macro-current-account",
            "price": "$0.28"
          },
          {
            "id": "macro-remittances",
            "price": "$0.09"
          },
          {
            "id": "macro-fdi",
            "price": "$0.28"
          },
          {
            "id": "macro-debt",
            "price": "$0.25"
          },
          {
            "id": "macro-credit",
            "price": "$0.13"
          },
          {
            "id": "macro-market-cap",
            "price": "$0.13"
          },
          {
            "id": "macro-population",
            "price": "$0.09"
          },
          {
            "id": "macro-population-growth",
            "price": "$0.13"
          },
          {
            "id": "macro-life-expectancy",
            "price": "$0.12"
          },
          {
            "id": "macro-unemployment",
            "price": "$0.13"
          },
          {
            "id": "macro-labor-force",
            "price": "$0.13"
          },
          {
            "id": "macro-gini",
            "price": "$0.25"
          },
          {
            "id": "macro-economic-structure",
            "price": "$0.28"
          },
          {
            "id": "macro-fiscal",
            "price": "$0.25"
          },
          {
            "id": "macro-rnd",
            "price": "$0.12"
          },
          {
            "id": "macro-patents",
            "price": "$0.07"
          },
          {
            "id": "macro-energy",
            "price": "$0.12"
          },
          {
            "id": "macro-co2",
            "price": "$0.12"
          },
          {
            "id": "macro-air-quality",
            "price": "$0.11"
          },
          {
            "id": "macro-food",
            "price": "$0.07"
          },
          {
            "id": "macro-health",
            "price": "$0.08"
          },
          {
            "id": "macro-military",
            "price": "$0.25"
          },
          {
            "id": "macro-digital",
            "price": "$0.13"
          },
          {
            "id": "macro-real-gdp",
            "price": "$0.13"
          },
          {
            "id": "macro-gni-per-capita",
            "price": "$0.13"
          },
          {
            "id": "macro-tech-exports",
            "price": "$0.12"
          },
          {
            "id": "macro-scientific-output",
            "price": "$0.11"
          },
          {
            "id": "macro-tertiary-education",
            "price": "$0.13"
          },
          {
            "id": "macro-broadband",
            "price": "$0.12"
          },
          {
            "id": "macro-internet-security",
            "price": "$0.12"
          },
          {
            "id": "macro-renewable-power",
            "price": "$0.10"
          },
          {
            "id": "macro-fossil-share",
            "price": "$0.12"
          },
          {
            "id": "macro-electricity-access",
            "price": "$0.08"
          },
          {
            "id": "macro-tariffs",
            "price": "$0.23"
          },
          {
            "id": "macro-tourism",
            "price": "$0.09"
          },
          {
            "id": "macro-debt-interest",
            "price": "$0.23"
          },
          {
            "id": "macro-population-aging",
            "price": "$0.13"
          },
          {
            "id": "macro-poverty",
            "price": "$0.25"
          },
          {
            "id": "macro-gender-parliament",
            "price": "$0.09"
          },
          {
            "id": "macro-forest",
            "price": "$0.07"
          },
          {
            "id": "macro-undernourishment",
            "price": "$0.11"
          },
          {
            "id": "macro-hospital-beds",
            "price": "$0.11"
          },
          {
            "id": "macro-military-spend",
            "price": "$0.25"
          },
          {
            "id": "theme-growth-quality",
            "price": "$0.28"
          },
          {
            "id": "theme-energy-transition",
            "price": "$0.25"
          },
          {
            "id": "theme-tech-capability",
            "price": "$0.25"
          },
          {
            "id": "theme-fiscal-space",
            "price": "$0.25"
          },
          {
            "id": "theme-demographic-shift",
            "price": "$0.28"
          },
          {
            "id": "theme-trade-exposure",
            "price": "$0.28"
          },
          {
            "id": "theme-human-capital",
            "price": "$0.28"
          },
          {
            "id": "theme-inclusion-poverty",
            "price": "$0.25"
          }
        ],
        "x-x402-payment": {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0xba7efeabfab91a6febc8d8088faa29ce95979b34",
          "facilitator": "https://facilitator.payai.network",
          "price": "dynamic; see /catalog",
          "flow": "Unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header. Sign the USDC transfer, then replay the same request with the payment signature. The response is HTTP 200."
        }
      }
    },
    "/report/custom": {
      "get": {
        "operationId": "getCustomReport",
        "summary": "Build a bespoke report from chosen indicators, economies and years",
        "tags": [
          "paid",
          "report"
        ],
        "parameters": [
          {
            "name": "indicators",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated indicator codes, or \"all\". See /indicators."
          },
          {
            "name": "countries",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated ISO-2 codes, or \"all\". Default: ten major economies."
          },
          {
            "name": "years",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}:\\d{4}$"
            },
            "description": "Inclusive year range, e.g. 2015:2025."
          },
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional title override."
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "json",
                "csv",
                "summary-csv"
              ],
              "default": "html"
            },
            "description": "Delivery format. html is the analytical document; json is the full structured payload; csv is a tidy long panel (one row per observation); summary-csv is one row per economy of derived metrics. An Accept header of application/json or text/csv is honoured when this is omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "The bespoke report in the requested format",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPayload"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unsupported indicator code, or unsupported format"
          },
          "402": {
            "description": "Payment required (price scales with request size)"
          }
        },
        "x-x402-payment": {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0xba7efeabfab91a6febc8d8088faa29ce95979b34",
          "facilitator": "https://facilitator.payai.network",
          "price": "$0.20 (indicative; scales with request size)",
          "flow": "Unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header. Sign the USDC transfer, then replay the same request with the payment signature. The response is HTTP 200."
        }
      }
    },
    "/report/bundle": {
      "get": {
        "operationId": "getBundle",
        "summary": "Fetch every catalog report in a single document",
        "tags": [
          "paid",
          "bundle"
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "json",
                "csv",
                "summary-csv"
              ],
              "default": "html"
            },
            "description": "Delivery format. html is the analytical document; json is the full structured payload; csv is a tidy long panel (one row per observation); summary-csv is one row per economy of derived metrics. An Accept header of application/json or text/csv is honoured when this is omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "The bundle in the requested format",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Payment required (x402 challenge)"
          },
          "503": {
            "description": "Bundle artefacts not assembled yet"
          }
        },
        "x-x402-payment": {
          "scheme": "exact",
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0xba7efeabfab91a6febc8d8088faa29ce95979b34",
          "facilitator": "https://facilitator.payai.network",
          "price": "$0.95",
          "flow": "Unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header. Sign the USDC transfer, then replay the same request with the payment signature. The response is HTTP 200."
        }
      }
    },
    "/preview/{id}": {
      "get": {
        "operationId": "getPreview",
        "summary": "Free machine-readable cross-section of a report",
        "description": "Free. Returns the latest year for every covered economy, the exact field names and types the paid payload uses, and an explicit list of what the purchase adds. Use it to check coverage before spending anything.",
        "tags": [
          "free",
          "conversion"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "macro-gdp",
                "macro-gdp-per-capita",
                "macro-gdp-ppp",
                "macro-gdp-growth",
                "macro-inflation",
                "macro-gdp-deflator",
                "macro-fx",
                "macro-trade",
                "macro-imports",
                "macro-trade-openness",
                "macro-current-account",
                "macro-remittances",
                "macro-fdi",
                "macro-debt",
                "macro-credit",
                "macro-market-cap",
                "macro-population",
                "macro-population-growth",
                "macro-life-expectancy",
                "macro-unemployment",
                "macro-labor-force",
                "macro-gini",
                "macro-economic-structure",
                "macro-fiscal",
                "macro-rnd",
                "macro-patents",
                "macro-energy",
                "macro-co2",
                "macro-air-quality",
                "macro-food",
                "macro-health",
                "macro-military",
                "macro-digital",
                "macro-real-gdp",
                "macro-gni-per-capita",
                "macro-tech-exports",
                "macro-scientific-output",
                "macro-tertiary-education",
                "macro-broadband",
                "macro-internet-security",
                "macro-renewable-power",
                "macro-fossil-share",
                "macro-electricity-access",
                "macro-tariffs",
                "macro-tourism",
                "macro-debt-interest",
                "macro-population-aging",
                "macro-poverty",
                "macro-gender-parliament",
                "macro-forest",
                "macro-undernourishment",
                "macro-hospital-beds",
                "macro-military-spend",
                "theme-growth-quality",
                "theme-energy-transition",
                "theme-tech-capability",
                "theme-fiscal-space",
                "theme-demographic-shift",
                "theme-trade-exposure",
                "theme-human-capital",
                "theme-inclusion-poverty"
              ]
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            },
            "description": "Preview delivery format."
          }
        ],
        "responses": {
          "200": {
            "description": "Free cross-section",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewPayload"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Unknown report id"
          }
        }
      }
    },
    "/schema/report.json": {
      "get": {
        "operationId": "getReportSchema",
        "summary": "JSON Schema for the preview and paid payloads",
        "tags": [
          "free",
          "discovery"
        ],
        "responses": {
          "200": {
            "description": "JSON Schema 2020-12",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/sample/{id}": {
      "get": {
        "operationId": "getSample",
        "summary": "Free reduced preview of a report",
        "tags": [
          "free"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "macro-gdp",
                "macro-gdp-per-capita",
                "macro-gdp-ppp",
                "macro-gdp-growth",
                "macro-inflation",
                "macro-gdp-deflator",
                "macro-fx",
                "macro-trade",
                "macro-imports",
                "macro-trade-openness",
                "macro-current-account",
                "macro-remittances",
                "macro-fdi",
                "macro-debt",
                "macro-credit",
                "macro-market-cap",
                "macro-population",
                "macro-population-growth",
                "macro-life-expectancy",
                "macro-unemployment",
                "macro-labor-force",
                "macro-gini",
                "macro-economic-structure",
                "macro-fiscal",
                "macro-rnd",
                "macro-patents",
                "macro-energy",
                "macro-co2",
                "macro-air-quality",
                "macro-food",
                "macro-health",
                "macro-military",
                "macro-digital",
                "macro-real-gdp",
                "macro-gni-per-capita",
                "macro-tech-exports",
                "macro-scientific-output",
                "macro-tertiary-education",
                "macro-broadband",
                "macro-internet-security",
                "macro-renewable-power",
                "macro-fossil-share",
                "macro-electricity-access",
                "macro-tariffs",
                "macro-tourism",
                "macro-debt-interest",
                "macro-population-aging",
                "macro-poverty",
                "macro-gender-parliament",
                "macro-forest",
                "macro-undernourishment",
                "macro-hospital-beds",
                "macro-military-spend",
                "theme-growth-quality",
                "theme-energy-transition",
                "theme-tech-capability",
                "theme-fiscal-space",
                "theme-demographic-shift",
                "theme-trade-exposure",
                "theme-human-capital",
                "theme-inclusion-poverty"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTML preview",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchCatalog",
        "summary": "Keyword search across the catalog",
        "tags": [
          "free"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching reports with prices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/catalog": {
      "get": {
        "operationId": "getCatalog",
        "summary": "Full catalog with live prices and sales counters",
        "tags": [
          "free"
        ],
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/indicators": {
      "get": {
        "operationId": "getIndicators",
        "summary": "Every supported indicator code and label",
        "tags": [
          "free"
        ],
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/agent.json": {
      "get": {
        "operationId": "getManifest",
        "summary": "x402 resource manifest",
        "tags": [
          "discovery"
        ],
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ReportPayload": {
        "type": "object",
        "description": "Paid JSON payload. Full JSON Schema: https://x402-report-store.app.workbuddy.host/schema/report.json",
        "required": [
          "kind",
          "report",
          "indicators"
        ],
        "properties": {
          "kind": {
            "const": "report"
          },
          "report": {
            "type": "object"
          },
          "indicators": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "crossCorrelations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "totals": {
            "type": "object"
          },
          "licence": {
            "type": "object"
          }
        }
      },
      "PreviewPayload": {
        "type": "object",
        "description": "Free JSON payload. Full JSON Schema: https://x402-report-store.app.workbuddy.host/schema/report.json",
        "required": [
          "kind",
          "report",
          "crossSection"
        ],
        "properties": {
          "kind": {
            "const": "preview"
          },
          "report": {
            "type": "object"
          },
          "latestYear": {
            "type": [
              "integer",
              "null"
            ]
          },
          "coveragePct": {
            "type": [
              "number",
              "null"
            ]
          },
          "crossSection": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "schema": {
            "type": "object"
          },
          "paidAdds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "purchase": {
            "type": "object"
          }
        }
      }
    }
  },
  "x-x402-service": {
    "network": "eip155:8453",
    "asset": "USDC",
    "payTo": "0xba7efeabfab91a6febc8d8088faa29ce95979b34",
    "facilitator": "https://facilitator.payai.network",
    "deliveryFormats": [
      "html",
      "json",
      "csv",
      "summary-csv"
    ],
    "schema": "https://x402-report-store.app.workbuddy.host/schema/report.json",
    "discovery": "https://facilitator.payai.network/discovery/resources?payTo=0xba7efeabfab91a6febc8d8088faa29ce95979b34"
  }
}