World Bank API–partea 1

M-am hotarit sa fac citesc API de la WorldBank. 

La ce bun?

1. Nu exista inca pachet de NuGet pentru asta

2. Vreau sa integrez Typescript cu roslyn

3. Vreau sa vad ce folosesc la un proiect de API

4. Vreau sa il trec prin diferite faze( optimizare , testare, etc)

5. Vreau sa am un proiect bun ( vezi 1)

Am citit documentatia de la https://datahelpdesk.worldbank.org/knowledgebase/articles/889386-developer-information-overview  si am zis sa aduc tarile lumii. Documentatia pentru tari o gasiti aici: https://datahelpdesk.worldbank.org/knowledgebase/articles/898590-api-country-queries si un exemplu de API http://api.worldbank.org/countries?format=json&page=2 

Am utilizat http://json2csharp.com/ ca sa scot modelele in C# din JSON ( au si XML – insa JSON e la ordinea zilei)

 

Asa ca m-am pomenit cu aceste clase:

Ce am mai observat; API-ul de Country de la WorldBank  nu contine doar tarile  – contine si date agregate (ca de exemplu

d":"DLA","iso2Code":"D2","name":"Latin America & the Caribbean (IDA-eligible countries)"

. Asa incit am doua functii:

public async Task<Country[]> GetCountriesWithAggregates()

si

public async Task<Country[]> GetCountries()

Asa ca , iata lista tarilor din lume obtinuta din codul urmator:


var c = new CountriesRepository();
var data = c.GetCountries().Result;
Console.WriteLine(data.Length);
foreach(var item in data)
      {                
          Console.WriteLine(item.id + "--" + item.name + " - " + "-" + item.incomeLevel.value);
      }

 

ABW–Aruba – -High income
AFG–Afghanistan – -Low income
AGO–Angola – -Upper middle income
ALB–Albania – -Upper middle income
AND–Andorra – -High income
ARE–United Arab Emirates – -High income
ARG–Argentina – -Upper middle income
ARM–Armenia – -Lower middle income
ASM–American Samoa – -Upper middle income
ATG–Antigua and Barbuda – -High income
AUS–Australia – -High income
AUT–Austria – -High income
AZE–Azerbaijan – -Upper middle income
BDI–Burundi – -Low income
BEL–Belgium – -High income
BEN–Benin – -Low income
BFA–Burkina Faso – -Low income
BGD–Bangladesh – -Lower middle income
BGR–Bulgaria – -Upper middle income
BHR–Bahrain – -High income
BHS–Bahamas, The – -High income
BIH–Bosnia and Herzegovina – -Upper middle income
BLR–Belarus – -Upper middle income
BLZ–Belize – -Upper middle income
BMU–Bermuda – -High income
BOL–Bolivia – -Lower middle income
BRA–Brazil – -Upper middle income
BRB–Barbados – -High income
BRN–Brunei Darussalam – -High income
BTN–Bhutan – -Lower middle income
BWA–Botswana – -Upper middle income
CAF–Central African Republic – -Low income
CAN–Canada – -High income
CHE–Switzerland – -High income
CHI–Channel Islands – -High income
CHL–Chile – -High income
CHN–China – -Upper middle income
CIV–Cote d’Ivoire – -Lower middle income
CMR–Cameroon – -Lower middle income
COD–Congo, Dem. Rep. – -Low income
COG–Congo, Rep. – -Lower middle income
COL–Colombia – -Upper middle income
COM–Comoros – -Low income
CPV–Cabo Verde – -Lower middle income
CRI–Costa Rica – -Upper middle income
CUB–Cuba – -Upper middle income
CUW–Curacao – -High income
CYM–Cayman Islands – -High income
CYP–Cyprus – -High income
CZE–Czech Republic – -High income
DEU–Germany – -High income
DJI–Djibouti – -Lower middle income
DMA–Dominica – -Upper middle income
DNK–Denmark – -High income
DOM–Dominican Republic – -Upper middle income
DZA–Algeria – -Upper middle income
ECU–Ecuador – -Upper middle income
EGY–Egypt, Arab Rep. – -Lower middle income
ERI–Eritrea – -Low income
ESP–Spain – -High income
EST–Estonia – -High income
ETH–Ethiopia – -Low income
FIN–Finland – -High income
FJI–Fiji – -Upper middle income
FRA–France – -High income
FRO–Faroe Islands – -High income
FSM–Micronesia, Fed. Sts. – -Lower middle income
GAB–Gabon – -Upper middle income
GBR–United Kingdom – -High income
GEO–Georgia – -Upper middle income
GHA–Ghana – -Lower middle income
GIB–Gibraltar – -High income
GIN–Guinea – -Low income
GMB–Gambia, The – -Low income
GNB–Guinea-Bissau – -Low income
GNQ–Equatorial Guinea – -Upper middle income
GRC–Greece – -High income
GRD–Grenada – -Upper middle income
GRL–Greenland – -High income
GTM–Guatemala – -Lower middle income
GUM–Guam – -High income
GUY–Guyana – -Upper middle income
HKG–Hong Kong SAR, China – -High income
HND–Honduras – -Lower middle income
HRV–Croatia – -High income
HTI–Haiti – -Low income
HUN–Hungary – -High income
IDN–Indonesia – -Lower middle income
IMN–Isle of Man – -High income
IND–India – -Lower middle income
IRL–Ireland – -High income
IRN–Iran, Islamic Rep. – -Upper middle income
IRQ–Iraq – -Upper middle income
ISL–Iceland – -High income
ISR–Israel – -High income
ITA–Italy – -High income
JAM–Jamaica – -Upper middle income
JOR–Jordan – -Upper middle income
JPN–Japan – -High income
KAZ–Kazakhstan – -Upper middle income
KEN–Kenya – -Lower middle income
KGZ–Kyrgyz Republic – -Lower middle income
KHM–Cambodia – -Lower middle income
KIR–Kiribati – -Lower middle income
KNA–St. Kitts and Nevis – -High income
KOR–Korea, Rep. – -High income
KWT–Kuwait – -High income
LAO–Lao PDR – -Lower middle income
LBN–Lebanon – -Upper middle income
LBR–Liberia – -Low income
LBY–Libya – -Upper middle income
LCA–St. Lucia – -Upper middle income
LIE–Liechtenstein – -High income
LKA–Sri Lanka – -Lower middle income
LSO–Lesotho – -Lower middle income
LTU–Lithuania – -High income
LUX–Luxembourg – -High income
LVA–Latvia – -High income
MAC–Macao SAR, China – -High income
MAF–St. Martin (French part) – -High income
MAR–Morocco – -Lower middle income
MCO–Monaco – -High income
MDA–Moldova – -Lower middle income
MDG–Madagascar – -Low income
MDV–Maldives – -Upper middle income
MEX–Mexico – -Upper middle income
MHL–Marshall Islands – -Upper middle income
MKD–Macedonia, FYR – -Upper middle income
MLI–Mali – -Low income
MLT–Malta – -High income
MMR–Myanmar – -Lower middle income
MNE–Montenegro – -Upper middle income
MNG–Mongolia – -Lower middle income
MNP–Northern Mariana Islands – -High income
MOZ–Mozambique – -Low income
MRT–Mauritania – -Lower middle income
MUS–Mauritius – -Upper middle income
MWI–Malawi – -Low income
MYS–Malaysia – -Upper middle income
NAM–Namibia – -Upper middle income
NCL–New Caledonia – -High income
NER–Niger – -Low income
NGA–Nigeria – -Lower middle income
NIC–Nicaragua – -Lower middle income
NLD–Netherlands – -High income
NOR–Norway – -High income
NPL–Nepal – -Low income
NRU–Nauru – -High income
NZL–New Zealand – -High income
OMN–Oman – -High income
PAK–Pakistan – -Lower middle income
PAN–Panama – -Upper middle income
PER–Peru – -Upper middle income
PHL–Philippines – -Lower middle income
PLW–Palau – -Upper middle income
PNG–Papua New Guinea – -Lower middle income
POL–Poland – -High income
PRI–Puerto Rico – -High income
PRK–Korea, Dem. PeopleΓÇÖs Rep. – -Low income
PRT–Portugal – -High income
PRY–Paraguay – -Upper middle income
PSE–West Bank and Gaza – -Lower middle income
PYF–French Polynesia – -High income
QAT–Qatar – -High income
ROU–Romania – -Upper middle income
RUS–Russian Federation – -Upper middle income
RWA–Rwanda – -Low income
SAU–Saudi Arabia – -High income
SDN–Sudan – -Lower middle income
SEN–Senegal – -Low income
SGP–Singapore – -High income
SLB–Solomon Islands – -Lower middle income
SLE–Sierra Leone – -Low income
SLV–El Salvador – -Lower middle income
SMR–San Marino – -High income
SOM–Somalia – -Low income
SRB–Serbia – -Upper middle income
SSD–South Sudan – -Low income
STP–Sao Tome and Principe – -Lower middle income
SUR–Suriname – -Upper middle income
SVK–Slovak Republic – -High income
SVN–Slovenia – -High income
SWE–Sweden – -High income
SWZ–Swaziland – -Lower middle income
SXM–Sint Maarten (Dutch part) – -High income
SYC–Seychelles – -High income
SYR–Syrian Arab Republic – -Lower middle income
TCA–Turks and Caicos Islands – -High income
TCD–Chad – -Low income
TGO–Togo – -Low income
THA–Thailand – -Upper middle income
TJK–Tajikistan – -Lower middle income
TKM–Turkmenistan – -Upper middle income
TLS–Timor-Leste – -Lower middle income
TON–Tonga – -Lower middle income
TTO–Trinidad and Tobago – -High income
TUN–Tunisia – -Lower middle income
TUR–Turkey – -Upper middle income
TUV–Tuvalu – -Upper middle income
TWN–Taiwan, China – -High income
TZA–Tanzania – -Low income
UGA–Uganda – -Low income
UKR–Ukraine – -Lower middle income
URY–Uruguay – -High income
USA–United States – -High income
UZB–Uzbekistan – -Lower middle income
VCT–St. Vincent and the Grenadines – -Upper middle income
VEN–Venezuela, RB – -Upper middle income
VGB–British Virgin Islands – -High income
VIR–Virgin Islands (U.S.) – -High income
VNM–Vietnam – -Lower middle income
VUT–Vanuatu – -Lower middle income
WSM–Samoa – -Lower middle income
XKX–Kosovo – -Lower middle income
YEM–Yemen, Rep. – -Lower middle income
ZAF–South Africa – -Upper middle income
ZMB–Zambia – -Lower middle income
ZWE–Zimbabwe – -Low income

 

Daca vreti sa participati, va rog sa va duceti pe GitHub la https://github.com/ignatandrei/WorldBankAPi

3 thoughts on “World Bank API–partea 1

  1. Provides an understanding of Open Data and how to get “up to speed” in planning and implementing an open data program. Visualizes how much development financing is provided and received around the world, including, financiers, donors, and beneficiaries.

Leave a Reply

Your email address will not be published. Required fields are marked *