World Bank Indicators Assistant
World Bank Indicators Assistant · GPT Actions
World Bank Open Data Access
This API combines actions that allow querying the World Bank Open Data for retrieving country-specific data, country listings, and global economic indicators.
GET /countryList CountriesGets a list of all countries and associated metadata.
GET /country/{country_code}/indicator/{indicator_name}Get Country Indicator DataRetrieves data for a specific indicator for a given country.
GET /indicatorList Global IndicatorsGets a list of global economic indicators.
原始 API 定义
{
"openapi": "3.0.0",
"info": {
"title": "World Bank Open Data Access",
"description": "This API combines actions that allow querying the World Bank Open Data for retrieving country-specific data, country listings, and global economic indicators.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.worldbank.org/v2"
}
],
"paths": {
"/country": {
"get": {
"summary": "List Countries",
"description": "Gets a list of all countries and associated metadata.",
"operationId": "listCountries",
"parameters": [
{
"name": "per_page",
"in": "query",
"description": "Number of countries to list per page.",
"required": false,
"schema": {
"type": "integer",
"default": 50
}
},
{
"name": "format",
"in": "query",
"description": "The format of the response data, defaults to JSON.",
"required": false,
"schema": {
"type": "string",
"enum": [
"json",
"xml"
]
}
}
],
"responses": {
"200": {
"description": "A list of countries with details.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CountryListResponse"
}
}
}
}
}
}
},
"/country/{country_code}/indicator/{indicator_name}": {
"get": {
"summary": "Get Country Indicator Data",
"description": "Retrieves data for a specific indicator for a given country.",
"operationId": "getCountryIndicatorData",
"parameters": [
{
"name": "country_code",
"in": "path",
"required": true,
"description": "Country code as per ISO 3166-1 alpha-2 codes.",
"schema": {
"type": "string"
}
},
{
"name": "indicator_name",
"in": "path",
"required": true,
"description": "The specific indicator code to retrieve data for.",
"schema": {
"type": "string"
}
},
{
"name": "date",
"in": "query",
"required": false,
"description": "The specific year or range of years to retrieve data for, separated by a colon.",
"schema": {
"type": "string",
"pattern": "^[0-9]{4}:[0-9]{4}$"
}
},
{
"name": "format",
"in": "query",
"description": "The format of the response data, defaults to JSON",
"required": false,
"schema": {
"type": "string",
"enum": [
"json",
"xml"
]
}
}
],
"responses": {
"200": {
"description": "Successful response with the data for the requested indicator and country.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndicatorData"
}
}
},
"application/xml": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndicatorData"
}
}
}
}
}
}
}
},
"/indicator": {
"get": {
"summary": "List Global Indicators",
"description": "Gets a list of global economic indicators.",
"operationId": "listGlobalIndicators",
"parameters": [
{
"name": "source",
"in": "query",
"description": "The source database to fetch indicators from, defaults to 2 for World Development Indicators.",
"required": false,
"schema": {
"type": "integer",
"default": 2
}
},
{
"name": "format",
"in": "query",
"description": "The format of the response data, defaults to JSON.",
"required": false,
"schema": {
"type": "string",
"enum": [
"json",
"xml"
]
}
}
],
"responses": {
"200": {
"description": "A list of global economic indicators.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"indicators": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Indicator"
}
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"CountryListResponse": {
"type": "object",
"properties": {
"page": {
"type": "integer"
},
"pages": {
"type": "integer"
},
"per_page": {
"type": "integer"
},
"total": {
"type": "integer"
},
"countries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Country"
}
}
}
},
"Country": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"iso2Code": {
"type": "string"
},
"name": {
"type": "string"
},
"region": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"adminregion": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"incomeLevel": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"lendingType": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"capitalCity": {
"type": "string"
},
"longitude": {
"type": "string"
},
"latitude": {
"type": "string"
}
}
},
"IndicatorData": {
"type": "object",
"properties": {
"indicator": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"country": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"value": {
"type": "string",
"nullable": true
},
"decimal": {
"type": "integer"
},
"date": {
"type": "string"
}
}
},
"Indicator": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"source": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"value": {
"type": "string"
}
}
},
"sourceNote": {
"type": "string"
},
"sourceOrganization": {
"type": "string"
}
}
}
}
}
}