{
  "openapi": "3.1.0",
  "info": {
    "title": "Eunoic API",
    "version": "1.0.0",
    "summary": "Sustainability disclosure scores, benchmarks, media sentiment and sustainability alpha.",
    "description": "Our own scores and statistics, never the text, prices or articles they are computed from. Every answer is {\"data\": ..., \"meta\": {...}} or {\"error\": {\"code\", \"message\"}, \"meta\": {...}}. Every ranked metric comes back as {value, sector, industry}, each rank as {rank, of, percentile}; rank 1 is always best. Keys are issued by Eunoic; send yours as 'Authorization: Bearer <key>'.",
    "contact": {"name": "Eunoic", "url": "https://eunoic.com/contact/"}
  },
  "servers": [{"url": "https://eunoic.com"}],
  "security": [{"apiKey": []}],
  "paths": {
    "/api/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Today's calls and scoring jobs used and left for your key's company",
        "responses": {
          "200": {"description": "Today's usage.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies": {
      "get": {
        "operationId": "findCompanies",
        "summary": "Up to 20 companies whose name or ticker matches, to find a company_id",
        "parameters": [{"name": "q", "in": "query", "required": true, "description": "2 to 120 characters of a company name or ticker.", "schema": {"type": "string", "minLength": 2, "maxLength": 120}}],
        "responses": {
          "200": {"description": "Matching companies.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompaniesAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/industries": {
      "get": {
        "operationId": "listIndustries",
        "summary": "Every sector and the industries in it, as all rankings and benchmarks name them",
        "responses": {
          "200": {"description": "Sectors and industries, alphabetical.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IndustriesAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies/{company_id}/index": {
      "get": {
        "operationId": "getIndexEntry",
        "summary": "A company's entry in the Sustainability Index: its latest ranked report",
        "parameters": [{"$ref": "#/components/parameters/CompanyId"}],
        "responses": {
          "200": {"description": "The Index entry, as of the last rankings rebuild.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IndexEntryAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies/{company_id}/reports": {
      "get": {
        "operationId": "listReports",
        "summary": "A company's stored reports, newest first, with their Index ranks",
        "parameters": [{"$ref": "#/components/parameters/CompanyId"}],
        "responses": {
          "200": {"description": "The company's reports.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportsAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/reports/{report_id}": {
      "get": {
        "operationId": "getReportBreakdown",
        "summary": "The full breakdown of one stored report, every score ranked against its sector and industry",
        "parameters": [
          {"name": "report_id", "in": "path", "required": true, "description": "A report_id from /api/v1/companies/{company_id}/reports.", "schema": {"type": "integer"}},
          {"$ref": "#/components/parameters/PerCompany"}, {"$ref": "#/components/parameters/ReportYear"},
          {"$ref": "#/components/parameters/Country"}, {"$ref": "#/components/parameters/Sectors"},
          {"$ref": "#/components/parameters/Industries"}, {"$ref": "#/components/parameters/Companies"}
        ],
        "responses": {
          "200": {"description": "The report's breakdown.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StoredReportAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies/{company_id}/website": {
      "get": {
        "operationId": "getWebsiteBreakdown",
        "summary": "A company's newest scored sustainability web page, if scored in the last year, ranked against websites",
        "parameters": [
          {"$ref": "#/components/parameters/CompanyId"}, {"$ref": "#/components/parameters/PerCompany"},
          {"$ref": "#/components/parameters/ReportYear"}, {"$ref": "#/components/parameters/Country"},
          {"$ref": "#/components/parameters/Sectors"}, {"$ref": "#/components/parameters/Industries"},
          {"$ref": "#/components/parameters/Companies"}
        ],
        "responses": {
          "200": {"description": "The page's breakdown, as of its capture.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StoredWebsiteAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/benchmarks": {
      "get": {
        "operationId": "getBenchmarks",
        "summary": "Theme weights for one sector or industry: rating agencies', investors' or a blend",
        "parameters": [
          {"$ref": "#/components/parameters/Sector"}, {"$ref": "#/components/parameters/Industry"},
          {"name": "basis", "in": "query", "description": "Whose weights. rating_agency by default.", "schema": {"type": "string", "enum": ["rating_agency", "investor", "blend"]}},
          {"name": "investor_share", "in": "query", "description": "With basis=blend only: the investors' share, 0 to 1 (0.5 by default).", "schema": {"type": "number", "minimum": 0, "maximum": 1}}
        ],
        "responses": {
          "200": {"description": "The weights; each basis sums to 1.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BenchmarksAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/alpha-benchmarks": {
      "get": {
        "operationId": "getAlphaBenchmarks",
        "summary": "How sustainability news has moved the alpha of a sector's or industry's companies, per theme",
        "parameters": [
          {"$ref": "#/components/parameters/Sector"}, {"$ref": "#/components/parameters/Industry"},
          {"name": "year", "in": "query", "description": "Windows ending in this year, or all from 2023 on (the default).", "schema": {"type": "string", "enum": ["all", "2026", "2025", "2024", "2023"]}}
        ],
        "responses": {
          "200": {"description": "One row per theme, as of the last window's end.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AlphaBenchmarksAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/keywords": {
      "get": {
        "operationId": "getKeywordDictionary",
        "summary": "Every theme with its description, keywords and framework tags",
        "responses": {
          "200": {"description": "The dictionary.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KeywordsAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies/{company_id}/sentiment": {
      "get": {
        "operationId": "getMediaSentiment",
        "summary": "Our sentiment scores for a company's news coverage of a theme, with the trend. Never headlines, sources or links",
        "parameters": [
          {"$ref": "#/components/parameters/CompanyId"},
          {"name": "from", "in": "query", "description": "First day, YYYY-MM-DD. 90 days before 'to' by default.", "schema": {"type": "string", "format": "date"}},
          {"name": "to", "in": "query", "description": "Last day, YYYY-MM-DD, no later than today (the default). At most 730 days after 'from'.", "schema": {"type": "string", "format": "date"}},
          {"name": "theme", "in": "query", "description": "All (the default), a pillar or a theme, as /api/v1/keywords names them.", "schema": {"type": "string"}},
          {"name": "period", "in": "query", "description": "The trend compares the latest complete day, week (Monday to Sunday) or calendar month before today with the one before it. month by default.", "schema": {"type": "string", "enum": ["day", "week", "month"]}}
        ],
        "responses": {
          "200": {"description": "The scores, as of the newest article.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SentimentAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/companies/{company_id}/sustainability-alpha": {
      "get": {
        "operationId": "getSustainabilityAlpha",
        "summary": "How sustainability news has moved a company's alpha, per theme",
        "parameters": [{"$ref": "#/components/parameters/CompanyId"}],
        "responses": {
          "200": {"description": "One row per theme, as of the latest window's end.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SustainabilityAlphaAnswer"}}}},
          "401": {"$ref": "#/components/responses/Unauthorised"}, "403": {"$ref": "#/components/responses/Forbidden"},
          "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/report-assessments": {
      "post": {
        "operationId": "scoreReport",
        "summary": "Send a report, as a PDF file or a link to one, for scoring. Counts as one of the day's scoring jobs",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {"schema": {"type": "object", "required": ["file", "name"], "properties": {
              "file": {"type": "string", "format": "binary", "description": "The PDF, at most 100 MB."},
              "name": {"$ref": "#/components/schemas/DocumentName"},
              "company_id": {"type": "integer", "description": "A company from /api/v1/companies, or your own."},
              "company_name": {"type": "string", "description": "For a company not listed, with its industry."},
              "industry": {"type": "string", "description": "With company_name: an industry from /api/v1/industries."}}}},
            "application/json": {"schema": {"$ref": "#/components/schemas/LinkSubmission"}}
          }
        },
        "responses": {
          "202": {"description": "Queued. Read it back with the job_id; the same request again returns the same job.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JobQueuedAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/report-assessments/{job_id}": {
      "get": {
        "operationId": "getReportScore",
        "summary": "A report scoring job's status and, once scored, its full breakdown",
        "parameters": [
          {"$ref": "#/components/parameters/JobId"}, {"$ref": "#/components/parameters/PerCompany"},
          {"$ref": "#/components/parameters/ReportYear"}, {"$ref": "#/components/parameters/Country"},
          {"$ref": "#/components/parameters/Sectors"}, {"$ref": "#/components/parameters/Industries"},
          {"$ref": "#/components/parameters/Companies"}
        ],
        "responses": {
          "200": {"description": "The job; the breakdown's groups appear once status is succeeded.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReportJobAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/website-assessments": {
      "post": {
        "operationId": "scoreWebsite",
        "summary": "Send a sustainability web page's link for scoring. Counts as one of the day's scoring jobs",
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LinkSubmission"}}}},
        "responses": {
          "202": {"description": "Queued. Read it back with the job_id; the same request again returns the same job.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JobQueuedAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/LimitReached"},
          "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    },
    "/api/v1/website-assessments/{job_id}": {
      "get": {
        "operationId": "getWebsiteScore",
        "summary": "A web page scoring job's status and, once scored, its full breakdown ranked against websites",
        "parameters": [
          {"$ref": "#/components/parameters/JobId"}, {"$ref": "#/components/parameters/PerCompany"},
          {"$ref": "#/components/parameters/ReportYear"}, {"$ref": "#/components/parameters/Country"},
          {"$ref": "#/components/parameters/Sectors"}, {"$ref": "#/components/parameters/Industries"},
          {"$ref": "#/components/parameters/Companies"}
        ],
        "responses": {
          "200": {"description": "The job; the breakdown's groups appear once status is succeeded.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebsiteJobAnswer"}}}},
          "400": {"$ref": "#/components/responses/InvalidRequest"}, "401": {"$ref": "#/components/responses/Unauthorised"},
          "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"},
          "429": {"$ref": "#/components/responses/LimitReached"}, "503": {"$ref": "#/components/responses/Unavailable"}
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {"type": "http", "scheme": "bearer", "description": "Your key, eun_live_ followed by 43 characters, issued by Eunoic."}
    },
    "parameters": {
      "CompanyId": {"name": "company_id", "in": "path", "required": true, "description": "A company_id from /api/v1/companies.", "schema": {"type": "integer"}},
      "JobId": {"name": "job_id", "in": "path", "required": true, "description": "The job_id the submission returned.", "schema": {"type": "string"}},
      "Sector": {"name": "sector", "in": "query", "description": "One sector, as /api/v1/industries names it. Send sector or industry, not both.", "schema": {"type": "string"}},
      "Industry": {"name": "industry", "in": "query", "description": "One industry, as /api/v1/industries names it. Send sector or industry, not both.", "schema": {"type": "string"}},
      "PerCompany": {"name": "per_company", "in": "query", "description": "Rank against each company's newest document (latest, the default) or every document (all).", "schema": {"type": "string", "enum": ["latest", "all"]}},
      "ReportYear": {"name": "year", "in": "query", "description": "Rank against documents from this year only.", "schema": {"type": "integer", "minimum": 1990, "maximum": 2100}},
      "Country": {"name": "country", "in": "query", "description": "Rank against companies in this country only (two-letter code).", "schema": {"type": "string", "minLength": 2, "maxLength": 3}},
      "Sectors": {"name": "sectors", "in": "query", "description": "A custom peer group: up to 20 sectors, comma-separated. Adds a peers rank to every metric.", "schema": {"type": "string"}},
      "Industries": {"name": "industries", "in": "query", "description": "A custom peer group: up to 50 industries, comma-separated.", "schema": {"type": "string"}},
      "Companies": {"name": "companies", "in": "query", "description": "A custom peer group: up to 100 company_ids, comma-separated.", "schema": {"type": "string"}}
    },
    "responses": {
      "InvalidRequest": {"description": "invalid_request: a parameter is missing or wrong; the message says which.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}},
      "Unauthorised": {"description": "unauthorised: no key, or a key that is unknown or revoked.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}},
      "Forbidden": {"description": "forbidden: API access isn't in the account's plan, or its subscription isn't active.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}},
      "NotFound": {"description": "not_found: no such company, report or job for this key.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}},
      "LimitReached": {"description": "limit_reached: today's calls or scoring jobs are used. Retry-After says when to try again.", "headers": {"Retry-After": {"description": "Seconds until the limit resets.", "schema": {"type": "integer"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}},
      "Unavailable": {"description": "unavailable: a temporary fault on our side. Try again in a minute.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorAnswer"}}}}
    },
    "schemas": {
      "Meta": {"type": "object", "required": ["request_id", "as_of", "methodology_version"], "properties": {
        "request_id": {"type": "string", "description": "Quote it when contacting us about a call."},
        "as_of": {"type": "string", "description": "How current the data is: the rankings rebuild, the capture, the newest article or window, or the time of the call."},
        "methodology_version": {"type": "string"}}},
      "ErrorAnswer": {"type": "object", "required": ["error", "meta"], "properties": {
        "error": {"type": "object", "required": ["code", "message"], "properties": {
          "code": {"type": "string", "enum": ["invalid_request", "unauthorised", "forbidden", "not_found", "limit_reached", "unavailable"]},
          "message": {"type": "string"}}},
        "meta": {"$ref": "#/components/schemas/Meta"}}},
      "Count": {"type": "object", "properties": {"used": {"type": "integer"}, "limit": {"type": "integer"}, "remaining": {"type": "integer"}}},
      "UsageAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "date": {"type": "string", "format": "date"}, "resets_in_seconds": {"type": "integer"},
        "calls": {"$ref": "#/components/schemas/Count"}, "jobs": {"$ref": "#/components/schemas/Count"}}}}},
      "Company": {"type": "object", "properties": {
        "company_id": {"type": "integer"}, "name": {"type": "string"}, "ticker": {"type": ["string", "null"]},
        "sector": {"type": ["string", "null"]}, "industry": {"type": ["string", "null"]}, "country": {"type": ["string", "null"]}}},
      "CompaniesAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Company"}}}},
      "IndustriesAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "sectors": {"type": "array", "items": {"type": "object", "properties": {"sector": {"type": "string"}, "industries": {"type": "array", "items": {"type": "string"}}}}}}}}},
      "IndexEntry": {"type": "object", "properties": {
        "report_id": {"type": "integer"}, "company_name": {"type": "string"}, "ticker": {"type": ["string", "null"]},
        "sector": {"type": "string"}, "industry": {"type": ["string", "null"]}, "report_name": {"type": "string"},
        "report_year": {"type": ["integer", "null"]}, "report_link": {"type": ["string", "null"]},
        "rank": {"type": ["integer", "null"], "description": "Place in its sector; 1 is best."},
        "sector_ranked": {"type": ["integer", "null"], "description": "How many reports its sector ranks."},
        "index_score": {"type": ["number", "null"]}, "accessibility": {"type": ["number", "null"]},
        "comprehensibility": {"type": ["number", "null"]}, "people_readability": {"type": ["number", "null"]},
        "emphasis": {"type": ["number", "null"]}, "alignment": {"type": ["number", "null"]},
        "not_assessable_reason": {"type": ["string", "null"], "description": "Why the Index doesn't rank it, when it doesn't."}}},
      "IndexEntryAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "company_id": {"type": "integer"}, "rankings_updated": {"type": ["string", "null"]}, "entry": {"$ref": "#/components/schemas/IndexEntry"}}}}},
      "ReportsAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "array", "items": {"type": "object", "properties": {
        "report_id": {"type": "integer"}, "name": {"type": "string"}, "year": {"type": ["integer", "null"]}, "link": {"type": ["string", "null"]},
        "index_rank": {"type": ["integer", "null"]}, "sector_ranked": {"type": ["integer", "null"]}, "not_ranked_reason": {"type": ["string", "null"]}}}}}},
      "Rank": {"type": ["object", "null"], "description": "Null when the value is missing.", "properties": {
        "rank": {"type": "integer", "description": "1 is best."}, "of": {"type": "integer", "description": "Peers, this document included."},
        "percentile": {"type": "integer", "description": "Share of peers it matches or beats, 0 to 100."}}},
      "RankedMetric": {"type": "object", "properties": {
        "value": {"type": ["number", "null"]}, "sector": {"$ref": "#/components/schemas/Rank"}, "industry": {"$ref": "#/components/schemas/Rank"},
        "peers": {"$ref": "#/components/schemas/Rank", "description": "Only when a custom peer group is asked for."}}},
      "ValueOnly": {"type": "object", "properties": {"value": {"type": ["number", "null"]}}},
      "Readability": {"type": "object", "properties": {
        "flesch_reading_ease": {"$ref": "#/components/schemas/RankedMetric"}, "flesch_kincaid_grade": {"$ref": "#/components/schemas/RankedMetric"},
        "gunning_fog": {"$ref": "#/components/schemas/RankedMetric"}, "smog_index": {"$ref": "#/components/schemas/RankedMetric"},
        "automated_readability_index": {"$ref": "#/components/schemas/RankedMetric"}, "linsear_write": {"$ref": "#/components/schemas/RankedMetric"},
        "coleman_liau_index": {"$ref": "#/components/schemas/RankedMetric"}, "dale_chall": {"$ref": "#/components/schemas/RankedMetric"},
        "readability_consensus": {"$ref": "#/components/schemas/RankedMetric"}, "rai_raw": {"$ref": "#/components/schemas/RankedMetric"},
        "rai_real": {"$ref": "#/components/schemas/RankedMetric"}, "prose_quality": {"$ref": "#/components/schemas/RankedMetric"},
        "reading_time": {"$ref": "#/components/schemas/ValueOnly"}}},
      "ThemeWeight": {"type": "object", "properties": {"pillar": {"type": "string"}, "theme": {"type": "string"}, "weight": {"type": ["number", "null"]}}},
      "Breakdown": {"type": "object", "properties": {
        "document": {"type": "object", "properties": {
          "name": {"type": "string"}, "year": {"type": ["integer", "null"]}, "characters": {"type": ["integer", "null"]},
          "analysis_date": {"type": ["string", "null"]}, "link": {"type": ["string", "null"]}, "methodology_version": {"type": "string"},
          "sector": {"type": ["string", "null"]}, "industry": {"type": ["string", "null"]}}},
        "accessibility": {"type": "object", "properties": {"remaining_text": {"$ref": "#/components/schemas/RankedMetric"}}},
        "emphasis": {"type": "object", "properties": {"sustainability_keyword_ratio": {"$ref": "#/components/schemas/RankedMetric"}}},
        "readability_people": {"$ref": "#/components/schemas/Readability"},
        "readability_ai": {"$ref": "#/components/schemas/Readability"},
        "theme_weights": {"type": "array", "items": {"$ref": "#/components/schemas/ThemeWeight"}},
        "alignment": {"type": "object", "properties": {
          "score": {"$ref": "#/components/schemas/RankedMetric"},
          "themes": {"type": "array", "items": {"type": "object", "properties": {
            "pillar": {"type": "string"}, "theme": {"type": "string"}, "weight": {"type": ["number", "null"]},
            "benchmark": {"type": ["number", "null"]}, "gap": {"type": ["number", "null"]}}}}}}}},
      "IndexPosition": {"type": "object", "description": "Where the report would sit in the Sustainability Index.", "properties": {
        "index_score": {"type": ["number", "null"]}, "rank": {"type": ["integer", "null"]}, "sector_ranked": {"type": ["integer", "null"]},
        "not_assessable_reason": {"type": ["string", "null"]}}},
      "StoredReportAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"allOf": [
        {"type": "object", "properties": {"report_id": {"type": "integer"}, "company_id": {"type": "integer"}, "index": {"$ref": "#/components/schemas/IndexPosition"}}},
        {"$ref": "#/components/schemas/Breakdown"}]}}},
      "StoredWebsiteAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"allOf": [
        {"type": "object", "properties": {"company_id": {"type": "integer"}, "website_id": {"type": "integer"}}},
        {"$ref": "#/components/schemas/Breakdown"}]}}},
      "BenchmarksAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "market": {"$ref": "#/components/schemas/Market"}, "basis": {"type": "string"}, "investor_share": {"type": ["number", "null"]},
        "weights": {"type": "array", "items": {"$ref": "#/components/schemas/ThemeWeight"}}}}}},
      "Market": {"type": "object", "properties": {"type": {"type": "string", "enum": ["sector", "industry"]}, "name": {"type": "string"}, "sector": {"type": "string"}}},
      "AlphaBenchmarksAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "market": {"$ref": "#/components/schemas/Market"}, "year": {"type": "string"},
        "windows": {"type": "object", "properties": {"first_start": {"type": ["string", "null"]}, "last_end": {"type": ["string", "null"]}}},
        "themes": {"type": "array", "items": {"type": "object", "properties": {
          "theme": {"type": "string"}, "pillar": {"type": "string"}, "n_windows": {"type": "integer"},
          "positive_share": {"type": "number"}, "median_impact": {"type": "number"}, "mean_strength": {"type": "number", "description": "Mean R squared, 0 to 1."},
          "direction": {"type": "string", "enum": ["Financial value", "Broad stakeholder value"]},
          "thin": {"type": "boolean", "description": "Fewer than 3 windows."},
          "from_sector": {"type": "boolean", "description": "The industry has no windows of its own; these are its sector's."}}}}}}}},
      "KeywordsAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "array", "items": {"type": "object", "properties": {
        "pillar": {"type": "string"}, "theme": {"type": "string"}, "description": {"type": ["string", "null"]},
        "keywords": {"type": "array", "items": {"type": "object", "properties": {"keyword": {"type": "string"}, "frameworks": {"type": "array", "items": {"type": "string"}}}}}}}}}},
      "SentimentAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "company_id": {"type": "integer"}, "theme": {"type": "string"}, "from": {"type": "string", "format": "date"}, "to": {"type": "string", "format": "date"},
        "compound": {"type": ["number", "null"], "description": "Mean compound score, -1 to 1."},
        "positive": {"type": ["number", "null"]}, "neutral": {"type": ["number", "null"]}, "negative": {"type": ["number", "null"], "description": "Mean negative share, 0 to 1."},
        "label": {"type": ["string", "null"]}, "n_found": {"type": "integer"}, "n_scored": {"type": "integer"},
        "thin": {"type": "boolean", "description": "True when the range holds between 1 and 9 scored articles."},
        "tone": {"type": "object", "properties": {"positive": {"type": "integer"}, "neutral": {"type": "integer"}, "negative": {"type": "integer"}, "unscored": {"type": "integer"}}},
        "pillars": {"type": "array", "items": {"type": "object", "properties": {"pillar": {"type": "string"}, "compound": {"type": ["number", "null"]}, "label": {"type": ["string", "null"]}, "n_scored": {"type": "integer"}}}},
        "timeline": {"type": ["object", "null"], "properties": {"dates": {"type": "array", "items": {"type": "string"}}, "values": {"type": "array", "items": {"type": "number"}}, "weekly": {"type": "boolean"}}},
        "trend": {"type": "object", "properties": {
          "period": {"type": "string"}, "current": {"type": ["number", "null"]}, "previous": {"type": ["number", "null"]}, "change": {"type": ["number", "null"]},
          "n_current": {"type": "integer"}, "n_previous": {"type": "integer"},
          "current_dates": {"type": "array", "items": {"type": "string"}}, "previous_dates": {"type": "array", "items": {"type": "string"}},
          "thin": {"type": "boolean"}}},
        "newest_date": {"type": ["string", "null"]}}}}},
      "SustainabilityAlphaAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "company_id": {"type": "integer"}, "significant_below": {"type": "number", "description": "Only windows with a p-value under this are stored."},
        "n_windows": {"type": "integer"}, "first_start": {"type": ["string", "null"]}, "latest_end": {"type": ["string", "null"]},
        "themes": {"type": "array", "items": {"type": "object", "properties": {
          "theme": {"type": "string"}, "n_windows": {"type": "integer"}, "share_positive": {"type": "number"}, "mean_strength": {"type": ["number", "null"]},
          "latest_window": {"type": "object", "properties": {
            "start": {"type": ["string", "null"]}, "end": {"type": ["string", "null"]}, "impact": {"type": "number"},
            "p_value": {"type": ["number", "null"]}, "r_squared": {"type": ["number", "null"]},
            "correlation": {"type": ["number", "null"], "description": "sign(impact) x square root of R squared."},
            "n_observations": {"type": ["integer", "null"]}}}}}}}}}},
      "DocumentName": {"type": "string", "minLength": 1, "maxLength": 200, "description": "The name the result is saved under; no slashes or line breaks."},
      "LinkSubmission": {"type": "object", "required": ["url", "name"], "properties": {
        "url": {"type": "string", "format": "uri", "description": "A public http or https link."},
        "name": {"$ref": "#/components/schemas/DocumentName"},
        "company_id": {"type": "integer", "description": "A company from /api/v1/companies, or your own."},
        "company_name": {"type": "string", "description": "For a company not listed, with its industry."},
        "industry": {"type": "string", "description": "With company_name: an industry from /api/v1/industries."}}},
      "JobQueuedAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"type": "object", "properties": {
        "job_id": {"type": "string"}, "status": {"type": "string", "enum": ["pending"]}}}}},
      "JobStatus": {"type": "object", "properties": {
        "job_id": {"type": "string"}, "status": {"type": "string", "enum": ["pending", "running", "succeeded", "failed"]},
        "error": {"type": ["string", "null"], "description": "Why a failed job failed."}}},
      "ReportJobAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"allOf": [
        {"$ref": "#/components/schemas/JobStatus"}, {"$ref": "#/components/schemas/Breakdown"},
        {"type": "object", "properties": {"index": {"$ref": "#/components/schemas/IndexPosition"}}}]}}},
      "WebsiteJobAnswer": {"type": "object", "properties": {"meta": {"$ref": "#/components/schemas/Meta"}, "data": {"allOf": [
        {"$ref": "#/components/schemas/JobStatus"}, {"$ref": "#/components/schemas/Breakdown"}]}}}
    }
  }
}
