Statistics of the World Source Comparisons API
The Source Comparisons API from Statistics of the World — 1 operation(s) for source comparisons.
The Source Comparisons API from Statistics of the World — 1 operation(s) for source comparisons.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/statisticsoftheworld-com:statisticsoftheworld-com-source-comparisons-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Statistics of the World Source Comparisons API
description: REST API for global statistics. Every tier retains the 335-indicator public read catalog for 218 countries. Paid keys add higher request limits; bulk redistribution remains limited to source-cleared datasets, including the 281-indicator reviewed World Bank bundle. See https://statisticsoftheworld.com/pricing.
version: 2.9.0
contact:
name: Statistics of the World
url: https://statisticsoftheworld.com
email: api@statisticsoftheworld.com
servers:
- url: https://statisticsoftheworld.com
description: Production
security:
- {}
- ApiKeyAuth: []
tags:
- name: Source Comparisons
paths:
/api/v1/source-comparisons:
get:
operationId: getSourceComparison
summary: Compare archived IMF and World Bank readings and inspect SOTW recording history
description: 'Pilot: 20 economies and 10 macro concepts. Default selects Canada GDP in the latest common completed year before the SOTW cutoff UTC year. Exact years never substitute another period. Differences are withheld for incompatible scope, units or source attribution; rate differences are percentage points. SOTW recording times do not establish publisher publication, source availability or observation/forecast status. Retain returned asOf, revision and processing_version for replay; original raw source files remain private. Repeated or unknown query parameters are rejected. format=catalog is available without reading the archive and requires all selection filters to be omitted.'
parameters:
- name: concept
in: query
required: false
schema:
type: string
enum:
- gdp
- gdp-per-capita
- gdp-growth
- gdp-ppp
- gdp-per-capita-ppp
- inflation
- unemployment
- government-debt
- current-account
- investment
default: gdp
description: Supported macro concept. Omit for format=catalog.
- name: country
in: query
required: false
schema:
type: string
enum:
- ARG
- AUS
- BRA
- CAN
- CHN
- FRA
- DEU
- IND
- IDN
- ITA
- JPN
- KOR
- MEX
- NGA
- SAU
- ZAF
- ESP
- TUR
- GBR
- USA
default: CAN
description: One pilot economy; lowercase input is normalized to uppercase. Omit for format=catalog.
- name: year
in: query
required: false
schema:
oneOf:
- type: integer
minimum: 1960
maximum: 2100
- type: string
enum:
- common
default: common
description: A four-digit exact reference year or common for the latest shared past year. Current/future-year status remains unknown. Omit for format=catalog.
- name: as_of
in: query
required: false
schema:
type: string
pattern: ^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?(?:Z|[+-]\d{2}:\d{2}))?$
description: Valid calendar date (UTC midnight) or ISO timestamp with seconds and explicit timezone, up to six fractional digits. Year must be at least 1960; future cutoffs are invalid. Default is the stable latest archive boundary. Omit for format=catalog.
- name: revision
in: query
required: false
schema:
type: string
pattern: ^(0|[1-9]\d{0,18})$
description: Decimal archive transaction watermark, at most 9223372036854775807. Zero identifies a genuinely empty baseline.
description: Returned complete archive transaction watermark; requires as_of. Invalid/incomplete revisions are rejected. Zero is allowed only for a genuinely empty baseline. Omit for format=catalog.
- name: processing_version
in: query
required: false
schema:
type: string
enum:
- source-comparison-v1
default: source-comparison-v1
description: Pins comparison transformations. Unsupported versions fail; retain the original evidence file.
- name: format
in: query
required: false
schema:
type: string
enum:
- json
- evidence
- catalog
default: json
description: json returns a comparison bundle; evidence returns a checksum manifest plus pinned data attachment; catalog returns selectors without checking archive availability.
responses:
'200':
description: 'JSON comparison bundle (format=json), evidence attachment with manifest, pinned data and exact canonical data_json (format=evidence), or supported selector catalog (format=catalog). Successful missing-data comparisons retain explicit gaps. Cache-Control: no-store.'
headers:
Content-Disposition:
schema:
type: string
description: Attachment filename for format=evidence only.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/SourceComparisonCatalog'
- $ref: '#/components/schemas/SourceComparisonBundle'
- $ref: '#/components/schemas/SourceComparisonEvidence'
'400':
description: Invalid, repeated or unsupported parameter; unsupported processing version; future cutoff; invalid/incomplete revision; or selection filters supplied with format=catalog. No-store.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
'409':
description: Requested cutoff predates stored-state coverage. No live-table fallback. No-store.
content:
application/json:
schema:
type: object
required:
- error
- code
properties:
error:
type: string
code:
const: HISTORICAL_STATE_UNAVAILABLE
'503':
description: Required archive unavailable, malformed or unreadable, or a source capture is in progress. No successful partial comparison. No-store.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
code:
type: string
enum:
- SOURCE_CAPTURE_IN_PROGRESS
description: Present when an active capture prevents a consistent read.
tags:
- Source Comparisons
components:
schemas:
SourceComparisonCatalog:
type: object
required:
- schema_version
- processing_version
- concepts
- countries
- archiveAvailability
- timeBasis
- sourceAvailability
- note
properties:
schema_version:
const: 1
processing_version:
const: source-comparison-v1
concepts:
type: array
minItems: 10
maxItems: 10
items:
$ref: '#/components/schemas/SourceComparisonConcept'
countries:
type: array
minItems: 20
maxItems: 20
items:
$ref: '#/components/schemas/SourceComparisonCountry'
archiveAvailability:
const: not_checked
timeBasis:
const: sotw_recorded_at
sourceAvailability:
const: not_established
note:
type: string
SourceComparisonConcept:
type: object
required:
- id
- label
- unit
- format
- comparability
- notes
- imfId
- wbId
properties:
id:
type: string
enum:
- gdp
- gdp-per-capita
- gdp-growth
- gdp-ppp
- gdp-per-capita-ppp
- inflation
- unemployment
- government-debt
- current-account
- investment
label:
type: string
unit:
type: string
format:
type: string
enum:
- currency
- percent
- number
comparability:
type: string
enum:
- aligned
- definition_mismatch
- methodology_sensitive
notes:
type: string
imfId:
type: string
wbId:
type: string
SourceComparisonReading:
type: object
required:
- indicatorId
- source
- sourceUrl
- unit
- value
- rawValue
- normalizationFactor
- normalizationStatus
- referenceYear
- storedSource
- archivedSourceName
- archivedSourceUrl
- definitionOrigin
- unitOrigin
- catalogMetadataRetrievedAt
- availability
- observationStatus
- publisherVintage
- sourcePublishedAt
- sotwRowUpdatedAt
- definition
- methodology
- definitionUnit
- metadataUpdatedAt
- license
- attribution
- sourceCaptureSha256
- capturedAt
- processingVersion
properties:
indicatorId:
type: string
source:
type: string
enum:
- IMF
- World Bank
sourceUrl:
type: string
format: uri
unit:
type: string
value:
type:
- number
- 'null'
description: Normalized value only for reviewed compatible units and stored source attribution. Null can mean a missing reading or normalization withheld; inspect rawValue and normalizationStatus.
rawValue:
type:
- number
- 'null'
description: Native stored reading, before canonical scale normalization. It can remain numeric when value is null because review is required.
normalizationFactor:
type:
- number
- 'null'
normalizationStatus:
type: string
enum:
- reviewed
- requires_review
referenceYear:
type:
- integer
- 'null'
storedSource:
type:
- string
- 'null'
archivedSourceName:
type:
- string
- 'null'
archivedSourceUrl:
type:
- string
- 'null'
definitionOrigin:
type: string
enum:
- archived
- reviewed_catalog
unitOrigin:
type: string
enum:
- archived
- reviewed_catalog
catalogMetadataRetrievedAt:
type:
- string
- 'null'
format: date-time
availability:
type: string
enum:
- available
- missing
description: Availability of the raw stored reading, separate from normalization review.
observationStatus:
const: unknown
publisherVintage:
type: 'null'
sourcePublishedAt:
type: 'null'
sotwRowUpdatedAt:
type:
- string
- 'null'
format: date-time
definition:
type:
- string
- 'null'
methodology:
type:
- string
- 'null'
definitionUnit:
type:
- string
- 'null'
metadataUpdatedAt:
type:
- string
- 'null'
license:
type: string
attribution:
type: string
sourceCaptureSha256:
type:
- string
- 'null'
pattern: ^[a-f0-9]{64}$
capturedAt:
type:
- string
- 'null'
format: date-time
processingVersion:
type:
- string
- 'null'
description: Stored ingestion processing version, separate from the comparison processing_version.
SourceComparisonCountry:
type: object
required:
- id
- name
properties:
id:
type: string
enum:
- ARG
- AUS
- BRA
- CAN
- CHN
- FRA
- DEU
- IND
- IDN
- ITA
- JPN
- KOR
- MEX
- NGA
- SAU
- ZAF
- ESP
- TUR
- GBR
- USA
name:
type: string
SourceComparisonEvidence:
type: object
required:
- manifest
- data
- data_json
properties:
manifest:
type: object
required:
- schema_version
- kind
- processing_version
- data_sha256
- hash_encoding
- reproduce_url
- normalization
- calculation
- raw_sources
- limitations
properties:
schema_version:
const: 1
kind:
const: sotw_source_comparison_evidence
processing_version:
const: source-comparison-v1
data_sha256:
type: string
pattern: ^[a-f0-9]{64}$
description: SHA-256 of the exact UTF-8 encoding of data_json; do not reserialize data to verify this hash.
hash_encoding:
type: string
reproduce_url:
type: string
description: Relative endpoint URL pinned to as_of, revision and processing_version.
normalization:
type: string
calculation:
type: string
raw_sources:
type: string
description: Source capture hashes identify privately retained bytes; the export does not redistribute raw publisher files.
limitations:
type: array
items:
type: string
data:
allOf:
- $ref: '#/components/schemas/SourceComparisonBundle'
- properties:
selection:
properties:
as_of:
type: string
format: date-time
revision:
type: string
pattern: ^(0|[1-9]\d{0,18})$
description: Decimal archive transaction watermark, at most 9223372036854775807. Zero identifies a genuinely empty baseline.
data_json:
type: string
description: Exact canonical JSON string whose UTF-8 bytes are bound by manifest.data_sha256. Decoding this string yields data. Preserve this string to verify the evidence across programming languages.
SourceComparisonBundle:
type: object
required:
- schema_version
- processing_version
- selection
- concept
- country
- comparisonYear
- readings
- difference
- history
- provenance
- revisions
- diagnostics
properties:
schema_version:
const: 1
processing_version:
const: source-comparison-v1
selection:
type: object
required:
- concept
- country
- year
- as_of
- revision
properties:
concept:
type: string
enum:
- gdp
- gdp-per-capita
- gdp-growth
- gdp-ppp
- gdp-per-capita-ppp
- inflation
- unemployment
- government-debt
- current-account
- investment
country:
type: string
enum:
- ARG
- AUS
- BRA
- CAN
- CHN
- FRA
- DEU
- IND
- IDN
- ITA
- JPN
- KOR
- MEX
- NGA
- SAU
- ZAF
- ESP
- TUR
- GBR
- USA
year:
oneOf:
- type: integer
minimum: 1960
maximum: 2100
- const: common
as_of:
type:
- string
- 'null'
format: date-time
revision:
type:
- string
- 'null'
pattern: ^(0|[1-9]\d{0,18})$
concept:
$ref: '#/components/schemas/SourceComparisonConcept'
country:
$ref: '#/components/schemas/SourceComparisonCountry'
comparisonYear:
type:
- integer
- 'null'
readings:
type: array
minItems: 2
maxItems: 2
items:
$ref: '#/components/schemas/SourceComparisonReading'
difference:
type: object
required:
- absolute
- relativePercent
- unit
- label
- status
- reason
properties:
absolute:
type:
- number
- 'null'
description: IMF minus World Bank, withheld for incompatible scope/metadata or missing readings. Rate differences are percentage points.
relativePercent:
type:
- number
- 'null'
description: For level series only, absolute divided by the positive World Bank reading times 100. Never a relative-percent comparison of rates.
unit:
type: string
label:
const: IMF minus World Bank
status:
type: string
enum:
- comparable
- methodology_sensitive
- not_comparable
- missing
reason:
type: string
history:
type: array
items:
type: object
required:
- year
- imf
- worldBank
- imfRaw
- worldBankRaw
- difference
properties:
year:
type: integer
imf:
type:
- number
- 'null'
worldBank:
type:
- number
- 'null'
imfRaw:
type:
- number
- 'null'
worldBankRaw:
type:
- number
- 'null'
difference:
type:
- number
- 'null'
provenance:
type: object
required:
- asOf
- coverageStart
- timeBasis
- sourceAvailability
- revision
properties:
asOf:
type: string
format: date-time
description: Exact SOTW transaction-final recording cutoff, including submillisecond precision. Preserve together with revision for replay.
coverageStart:
type: string
format: date-time
timeBasis:
const: sotw_recorded_at
sourceAvailability:
const: not_established
revision:
type: string
pattern: ^(0|[1-9]\d{0,18})$
description: Decimal archive transaction watermark, at most 9223372036854775807. Zero identifies a genuinely empty baseline.
revisions:
type: array
maxItems: 2000
description: Selected-reference-year observation events and source metadata events; the latest 2,000 transaction-final events in the selected scope at most. Baseline is initial stored state, not publisher revision history.
items:
type: object
required:
- indicatorId
- referenceYear
- recordedAt
- operation
- value
- previousValue
- rawValue
- previousRawValue
- eventId
- kind
properties:
indicatorId:
type: string
referenceYear:
type:
- integer
- 'null'
recordedAt:
type: string
format: date-time
operation:
type: string
enum:
- baseline
- insert
- update
- delete
value:
type: 'null'
description: Historical event normalization is not established.
previousValue:
type: 'null'
rawValue:
type:
- number
- 'null'
previousRawValue:
type:
- number
- 'null'
eventId:
type: string
pattern: ^[1-9]\d{0,18}$
kind:
type: string
enum:
- observation
- metadata
diagnostics:
type: array
items:
type: string
description: Coverage limits, review requirements and publisher-vintage limitations.
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: Optional. Without a key, requests are limited to 1,000/day per IP. A free key adds a usage dashboard. Paid keys increase throughput without removing public sources. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Tier headers.