rhowb 1.0.3
Data from world bank api
Requires Python: >=3.12
Keywords: world bank, data

# World Bank Data Api

## Income Levels

WB assigns its economies to four income groups: low, lower-middle, upper-middle, and high. The classifications are updated each year on July 1, based on the GNI per capita of the previous calendar year. For example, the updated income classifications for FY2025, based on the GNI per capita of 2023.

GNI measures are expressed in US dollars using conversion factors derived according to the Atlas method. WB's income classification aims to reflect an economy’s level of development, drawing on Atlas GNI per capita as a broadly available indicator of economic capacity.

The classification of countries into income categories has evolved significantly over the period since the late 1980s. In 1987, 30% of reporting countries were classified as low-income and 25% as high-income countries. Jumping to 2023, these overall ratios have shifted down to 12% in the low-income category and up to 40% in the high-income category.

| FY    | LIC      | LMC            | UMC              | HIC          | Data for Calendar Year |
|:-----:|----------|----------------|------------------|--------------|------------------------|
| 2026  | <= 1135  | [1136, 4495]   | [4496, 13935]    | > 13935      | 2024                   |
| 2025  | <= 1145  | [1146, 4515]   | [4516, 14005]    | > 14005      | 2023                   |   
| 2024  | <= 1135  | [1136, 4465]   | [4466, 13845]    | > 13845      | 2022                   |
| 2023  | <= 1085  | [1086, 4255]   | [4266, 13205]    | > 13205      | 2021                   |
| 2022  | <= 1045  | [1046, 4095]   | [4096, 12695]    | > 12695      | 2020                   |
| 2021  | <= 1035  | [1036, 4045]   | [4046, 12535]    | > 12535      | 2019                   |
 
```
from wbdata import WB
wb = WB()
wb.incomelevels
```

## Lending Types

```
wb.lendingtypes
```

## Sources

By default, sources are read from local file. To get the latest sources from World Bank API, use:

```
wb.getsources(False)
```

## Regions

WB groupes its members into one of seven geographic regions:

- East Asia and Pacific
- Europe and Central Asia
- Latin America and the Caribbean
- Middle East and North Africa
- North America, South Asia
- Sub-Saharan Africa

Region info data are read from local file by default. To get the latest regions from World Bank API, use:

```
wb.getregions(False)
```

## Topics

Topic data are read from local file by default. To get the latest topics from World Bank API, use:

```
wb.gettopics(False)
```

## Query Economy's Information

name, id, region, incomelevel, lendingtype, capital, longitude, latitude, ...

Parameters used frequently (at least ONE of them):

- name
- region
- incomelevel
- lendingtype

```
wb.queryecons(name = 'China')   # info of China
wb.queryecons(region = 'EAS', incomelevel = 'HIC')   # high income economies in East Asia and Pacific
```

## Query Indicators

By default, indicators are queried from local file 

```
wb.queryinds(name = 'GDP Per Capita')
```

## Get Data

```
wb.getdata('NY.GDP.MKTP.KD', 'CHN', period = '2020:2024')
```