Chuyển đến nội dung chính

Getting Started with ECODATA API

This guide will help you start using the ECODATA API to access economic data programmatically.

Base URL

https://ecodata.khoviet.com/api/v1

Quick Start

  1. Get your API key from ECODATA Dashboard
  2. Install dependencies (optional - use any HTTP client)
  3. Make your first request
  4. Parse the response

First Request

Using cURL

curl -X GET "https://ecodata.khoviet.com/api/v1/indicators?source=WB&indicator=NY.GDP.MKTP.CD&country=VN&start_year=2020" \
-H "Authorization: Bearer YOUR_API_KEY"

Using Python

import requests

url = "https://ecodata.khoviet.com/api/v1/indicators"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
params = {
"source": "WB",
"indicator": "NY.GDP.MKTP.CD",
"country": "VN",
"start_year": 2020,
"end_year": 2023
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

print(data)

Using JavaScript

const response = await fetch(
"https://ecodata.khoviet.com/api/v1/indicators?" +
new URLSearchParams({
source: "WB",
indicator: "NY.GDP.MKTP.CD",
country: "VN",
start_year: 2020
}),
{
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
}
);

const data = await response.json();
console.log(data);

Response Format

{
"success": true,
"data": [
{
"indicator_code": "NY.GDP.MKTP.CD",
"indicator_name": "GDP (current US$)",
"country_code": "VN",
"country_name": "Vietnam",
"year": 2023,
"value": 430000000000,
"unit": "US$"
}
],
"metadata": {
"source": "World Bank - WDI",
"last_updated": "2024-03-15",
"total_records": 1
}
}

Rate Limits

PlanRequests/minuteRequests/day
Free10100
Basic601,000
Pro30010,000
EnterpriseUnlimitedUnlimited

Next Steps


Support

Need help? Contact support@khoviet.com