{
  "openapi": "3.1.0",
  "info": {
    "title": "ESGPulse API",
    "version": "1.0.0",
    "description": "AI-powered ESG and sustainability intelligence: CSRD compliance roadmaps, EU Taxonomy alignment, supply chain due diligence, emissions analysis, greenwashing risk, and ESG disclosure guidance. All endpoints require x402 USDC micropayment on Base mainnet.",
    "contact": { "name": "The Aslan Group LLC", "email": "info@theaslangroupllc.com" },
    "x-agent-network": "PulseNetwork",
    "x-payment-protocol": "x402",
    "x-payment-asset": "USDC on Base (eip155:8453)"
  },
  "servers": [{ "url": "https://esgpulse.vercel.app", "description": "Production" }],
  "paths": {
    "/api/esg/csrd": {
      "get": {
        "operationId": "csrdCompliance",
        "summary": "CSRD compliance roadmap",
        "description": "Returns a complete CSRD compliance roadmap: which reporting phase, mandatory ESRS standards, double materiality assessment guide, key deadlines, and estimated implementation effort. Mandatory for 50,000+ EU companies. Best starting point for any EU sustainability reporting project.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.25",
        "parameters": [
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector (retail, manufacturing, financial-services, technology, energy, healthcare, etc.)"},
          {"name": "employees", "in": "query", "schema": {"type": "string"}, "description": "Number of employees (e.g. 500, 5000)"},
          {"name": "turnover", "in": "query", "schema": {"type": "string"}, "description": "Annual turnover in EUR (e.g. 250000000 for €250M)"},
          {"name": "jurisdiction", "in": "query", "schema": {"type": "string", "default": "EU"}, "description": "Company's primary jurisdiction"},
          {"name": "listed", "in": "query", "schema": {"type": "boolean", "default": true}, "description": "Whether the company is publicly listed"},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}, "description": "Response language (ISO 639-1)"}
        ],
        "responses": {
          "200": {"description": "CSRD compliance roadmap", "content": {"application/json": {"schema": {"type": "object", "properties": {"phase": {"type": "object"}, "in_scope": {"type": "boolean"}, "mandatory_standards": {"type": "array"}, "double_materiality": {"type": "object"}, "timeline": {"type": "object"}, "key_deadlines": {"type": "array"}, "summary": {"type": "string"}}}}}},
          "402": {"description": "Payment required — attach PAYMENT-SIGNATURE header"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/framework": {
      "get": {
        "operationId": "esgFramework",
        "summary": "ESG framework navigator",
        "description": "Recommends which ESG frameworks apply to a company (GRI, ISSB/IFRS S1/S2, CSRD/ESRS, TCFD, CDP, SEC climate) and how to sequence implementation. Explains framework interoperability and shared data points to minimize reporting burden.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.15",
        "parameters": [
          {"name": "company_type", "in": "query", "schema": {"type": "string", "enum": ["large-public", "large-private", "sme", "financial-institution", "asset-manager"]}, "description": "Type of organization"},
          {"name": "jurisdiction", "in": "query", "schema": {"type": "string", "default": "EU"}, "description": "Primary regulatory jurisdiction"},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector"},
          {"name": "goal", "in": "query", "schema": {"type": "string", "enum": ["compliance", "investor", "customer", "all"], "default": "compliance"}, "description": "Primary reporting goal"},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Framework recommendation", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/company": {
      "get": {
        "operationId": "companyEsg",
        "summary": "Company ESG intelligence",
        "description": "Synthesizes publicly available ESG data on a named company: CDP scores, SBTi commitment status, Scope 1/2/3 emissions from public reports, board ESG governance, key controversies. Built from public disclosures — not proprietary rater data.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.15",
        "parameters": [
          {"name": "company", "in": "query", "required": true, "schema": {"type": "string"}, "description": "Company name (e.g. Apple, Unilever, HSBC)"},
          {"name": "focus", "in": "query", "schema": {"type": "string", "enum": ["all", "environment", "social", "governance", "emissions", "controversies"], "default": "all"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Company ESG profile", "content": {"application/json": {"schema": {"type": "object"}}}},
          "400": {"description": "Missing company parameter"},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/emissions": {
      "get": {
        "operationId": "emissionsIntelligence",
        "summary": "Carbon and emissions intelligence",
        "description": "Comprehensive emissions analysis: Scope 1/2/3 methodology and calculation guidance, current carbon market prices (EU ETS, California, voluntary offsets), CBAM tariff implications for trade-exposed sectors, SBTi pathway requirements, and net zero roadmap. Essential for carbon accounting and climate strategy.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.15",
        "parameters": [
          {"name": "entity", "in": "query", "schema": {"type": "string"}, "description": "Company or entity name (optional)"},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector for benchmark data"},
          {"name": "scope", "in": "query", "schema": {"type": "string", "enum": ["all", "scope1", "scope2", "scope3"], "default": "all"}},
          {"name": "goal", "in": "query", "schema": {"type": "string", "enum": ["measure", "reduce", "offset", "report", "comply"], "default": "measure"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Emissions intelligence", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/sector": {
      "get": {
        "operationId": "sectorMateriality",
        "summary": "SASB sector ESG materiality",
        "description": "Returns SASB-aligned sector materiality analysis: which ESG topics are financially material and impact-material for this industry, how ESG raters weight them, peer leaders, regulatory hotspots globally, and sector-specific reporting frameworks.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.15",
        "parameters": [
          {"name": "sector", "in": "query", "required": true, "schema": {"type": "string"}, "description": "Industry sector (Technology, Financial Services, Health Care, Energy, Consumer Goods, etc.)"},
          {"name": "focus", "in": "query", "schema": {"type": "string", "enum": ["all", "E", "S", "G", "regulatory", "financial"], "default": "all"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Sector materiality brief", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/taxonomy": {
      "get": {
        "operationId": "euTaxonomyAlignment",
        "summary": "EU Taxonomy alignment check",
        "description": "Assesses whether an economic activity qualifies as sustainable under the EU Taxonomy Regulation. Covers all 6 environmental objectives (CCM, CCA, WMR, CE, PPC, BIO), Do No Significant Harm criteria, minimum social safeguards, and implications for Article 8/9 funds and bank Green Asset Ratios.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.20",
        "parameters": [
          {"name": "activity", "in": "query", "schema": {"type": "string"}, "description": "Specific economic activity (e.g. solar energy generation, manufacture of cement)"},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector if activity not specified"},
          {"name": "objective", "in": "query", "schema": {"type": "string", "enum": ["all", "CCM", "CCA", "WMR", "CE", "PPC", "BIO"], "default": "all"}, "description": "EU Taxonomy environmental objective to assess"},
          {"name": "entity_type", "in": "query", "schema": {"type": "string", "enum": ["corporate", "fund", "bank"], "default": "corporate"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "EU Taxonomy alignment assessment", "content": {"application/json": {"schema": {"type": "object"}}}},
          "400": {"description": "Missing activity or sector parameter"},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/supply-chain": {
      "get": {
        "operationId": "supplyChainEsg",
        "summary": "Supply chain ESG due diligence",
        "description": "Supply chain ESG intelligence: CSDDD compliance obligations by company size, high-risk country profiles, sector-specific human rights and environmental risks, EU Forced Labour Regulation screening, US UFLPA (Uyghur Act) applicability, and supplier questionnaire templates.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.20",
        "parameters": [
          {"name": "company", "in": "query", "schema": {"type": "string"}, "description": "Company name for specific analysis"},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector for risk profile"},
          {"name": "origin_countries", "in": "query", "schema": {"type": "string"}, "description": "Comma-separated list of sourcing countries (e.g. CN,BD,VN)"},
          {"name": "scope", "in": "query", "schema": {"type": "string", "enum": ["full", "human-rights", "environment", "governance"], "default": "full"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Supply chain due diligence report", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/score": {
      "get": {
        "operationId": "esgScore",
        "summary": "ESG score intelligence",
        "description": "ESG rating methodology explainer: how MSCI, Sustainalytics, ISS, Bloomberg, CDP, and S&P Global score companies, why scores diverge for the same company, what drives score changes, and how companies can improve their ratings.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.10",
        "parameters": [
          {"name": "company", "in": "query", "schema": {"type": "string"}, "description": "Company name for specific intelligence"},
          {"name": "rater", "in": "query", "schema": {"type": "string", "enum": ["all", "MSCI", "Sustainalytics", "ISS", "Bloomberg", "CDP", "SP"], "default": "all"}},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector for benchmark context"},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "ESG score intelligence", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/greenwashing": {
      "get": {
        "operationId": "greenwashingRisk",
        "summary": "Greenwashing risk detector",
        "description": "Analyzes sustainability claims for greenwashing risk under the EU Green Claims Directive, FTC Green Guides, and UK CMA Green Claims Code. Provides claim-by-claim risk ratings, substantiation requirements, enforcement precedents, and compliant alternatives.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.15",
        "parameters": [
          {"name": "claims", "in": "query", "schema": {"type": "string"}, "description": "Sustainability claims to analyze (e.g. 'carbon neutral by 2030, eco-friendly packaging')"},
          {"name": "company", "in": "query", "schema": {"type": "string"}, "description": "Company name for controversy research"},
          {"name": "jurisdiction", "in": "query", "schema": {"type": "string", "enum": ["EU", "UK", "US", "AU", "global"], "default": "EU"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "Greenwashing risk assessment", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    },
    "/api/esg/disclosure": {
      "get": {
        "operationId": "esgDisclosure",
        "summary": "ESG disclosure builder",
        "description": "Practical disclosure guide: ESRS data points checklist, GRI content index template, TCFD 4-pillar structure, what to disclose and where. Covers CSRD, GRI, ISSB/IFRS S1+S2, TCFD, CDP, and SEC climate. Includes reporting calendar and common disclosure gaps.",
        "x-agent-use-case": "on-demand",
        "x-price-usdc": "0.20",
        "parameters": [
          {"name": "framework", "in": "query", "schema": {"type": "string", "enum": ["CSRD", "GRI", "ISSB", "TCFD", "CDP", "SEC", "all"], "default": "CSRD"}},
          {"name": "sector", "in": "query", "schema": {"type": "string"}, "description": "Industry sector for sector-specific data points"},
          {"name": "topic", "in": "query", "schema": {"type": "string", "enum": ["all", "climate", "water", "biodiversity", "social", "governance"], "default": "all"}},
          {"name": "format", "in": "query", "schema": {"type": "string", "enum": ["guide", "checklist", "template"], "default": "guide"}},
          {"name": "lang", "in": "query", "schema": {"type": "string", "default": "en"}}
        ],
        "responses": {
          "200": {"description": "ESG disclosure guide", "content": {"application/json": {"schema": {"type": "object"}}}},
          "402": {"description": "Payment required"}
        },
        "security": [{"x402": []}]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 USDC payment signature on Base mainnet (eip155:8453). Call without header to receive 402 with payment requirements."
      }
    }
  }
}
