Worldwide Governance Indicators API

331 views
Skip to first unread message

snep01

unread,
Apr 19, 2012, 9:22:44 AM4/19/12
to World Bank API
Dear Sir/Madam,

I need some data from Worldwide Governance Indicators to show
dynamically in my website.
Could you please help me where this API is located and how to get it?

Thanks a lot!

Sarven Capadisli

unread,
Apr 19, 2012, 12:26:15 PM4/19/12
to world-b...@googlegroups.com

Hi snep01,

Thanks for bringing this up! I didn't know this existed, but I've first
found this:

http://info.worldbank.org/governance/wgi/index.asp

Data is available in Excel format :(

Later I figured that the World Bank's data catalog:

http://data.worldbank.org/data-catalog

should mention this, and it did:

http://data.worldbank.org/data-catalog/worldwide-governance-indicators

But, when I quickly looked up some of the keywords from:

http://databank.worldbank.org/ddp/home.do?Step=12&id=4&CNO=1181

at:

http://data.worldbank.org/indicator

They didn't turn up.

However, if you inspect the list of indicators on the page at:

http://databank.worldbank.org/ddp/home.do?Step=2&id=4&hActiveDimensionId=WGI_Series
(this won't work for you as it is based on sessions but you can get
there by selecting a country).

the form control options use the same indicator notation patterns like
the other World Development Indicators. Hence, I looked them up and they
are indeed in the API. Good news!

If you don't want to bother with that, you can either search for those
keywords in the indicator API, or check this SPARQL query result:

NOTE: This is not endorsed by The World Bank in any way. It is a third
party service. You should always refer to The World Bank's API for data
validity.

http://worldbank.270a.info/sparql?query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+skos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0D%0APREFIX+classification%3A+%3Chttp%3A%2F%2Fworldbank.270a.info%2Fclassification%2F%3E%0D%0APREFIX+g-meta%3A+%3Chttp%3A%2F%2Fworldbank.270a.info%2Fgraph%2Fmeta%3E+%0D%0A%0D%0ASELECT+*%0D%0AWHERE+%7B%0D%0AGRAPH+g-meta%3A+%7B%0D%0A%3FindicatorURI%0D%0A++++skos%3AinScheme+classification%3Aindicator+%3B%0D%0A++++skos%3AprefLabel+%3FprefLabel+%3B%0D%0A++++skos%3Anotation+%3Fnotation+%3B%0D%0A++++foaf%3Apage+%3Fpage+%3B%0D%0A++++.%0D%0AFILTER+%28regex%28%3FprefLabel%2C+%22control+of+corruption%7Cgovernment+effectiveness%7Cpolitical+stability%7Cregulatory+quality%7Crule+of+law%7Cvoice+and+accountability%22%2C+%22i%22%29%29%0D%0A%7D%0D%0A%7D%0D%0AORDER+BY+%3Fnotation&default-graph-uri=&output=xml&stylesheet=%2Fxml-to-html.xsl

Note that, the tool on The World Bank website doesn't include the
indicator notations that start with "GV" and "MO", but as far as basic
keyword matches go, they are in the API. For instance, for "control of
corruption", there are two indicators:

http://data.worldbank.org/indicator/CC.EST

and

http://data.worldbank.org/indicator/GV.CONT.CO.ES

By looking at the others, it appears to be that the ones that start with
GV are African Development Indicators, whereas the other ones are World
Development Indicators.

In any case, here are the WGI codes that you need:

CC.EST
CC.NO.SRC
CC.PER.RNK
CC.STD.ERR
GE.EST
GE.NO.SRC
GE.PER.RNK
GE.STD.ERR
PV.EST
PV.NO.SRC
PV.PER.RNK
PV.STD.ERR
RL.EST
RL.NO.SRC
RL.PER.RNK
RL.STD.ERR
RQ.EST
RQ.NO.SRC
RQ.PER.RNK
RQ.STD.ERR
VA.EST
VA.NO.SRC
VA.PER.RNK
VA.STD.ERR

I'm not sure if there was an easier way that I've missed.

I don't know how you can show that dynamically on your website. Perhaps
there is a widget somewhere that allows you to select indicators and use
them as an iframe/object or whatnot.

Good luck,

-Sarven

Shanmugam Natarajan

unread,
Apr 19, 2012, 1:51:59 PM4/19/12
to World Bank API
Hi,

Thanks for writing us to know about Worldbank APIs. Here the WB API
calls to get the World Governance Indicators and their data,

List of API supported data sources:
http://api.worldbank.org/sources

World Governance Indicators (WGI) source:
http://api.worldbank.org/sources/3

Get the list of indicators from WGI source:
http://api.worldbank.org/sources/3/indicators

Get the WGI Indicator data (for ex., CC.EST) for all countries:
http://api.worldbank.org/countries/all/indicators/CC.EST?source=3

Get the WGI Indicator data (for ex., CC.EST) for given countries:
http://api.worldbank.org/countries/ago;chn;abw;usa/indicators/CC.EST?source=3

Refer http://data.worldbank.org/node/11 for more information about the
API call structures, and API query builder at: http://data.worldbank.org/querybuilder
Worldbank's data catalog exists at: http://data.worldbank.org/data-catalog

Hope these would help. Write us if you need any more information
regarding this.

Thanks and Regards,
Shanmugam

Sarven Capadisli

unread,
Apr 20, 2012, 4:10:31 AM4/20/12
to world-b...@googlegroups.com
Nice! I totally forgot about the source nodes in the indicator
meta-data, even though at one point I've looked up for source/topic in
the indicator data (observations) themselves.

I've noticed something in these observations however. It appears to be
that, the country @id value is blank. For instance:

cat CC.EST.xml | grep "country id=\"\"" | sort | uniq
<wb:country id="">Anguilla</wb:country>
<wb:country id="">Cook Islands</wb:country>
<wb:country id="">French Guiana</wb:country>
<wb:country id="">Martinique</wb:country>
<wb:country id="">Nauru</wb:country>
<wb:country id="">Netherlands Antilles</wb:country>
<wb:country id="">Niue</wb:country>
<wb:country id="">Reunion</wb:country>
<wb:country id="">Taiwan, China</wb:country>

There exists corresponding ISO_3166-2 codes for those areas. Was the
decision to leave them out intentional?

Thanks,

-Sarven

Shanmugam Natarajan

unread,
Apr 20, 2012, 3:16:48 PM4/20/12
to World Bank API
Hi Sarven,

We are checking this issue and get back to you once this gets
resolved.

Thanks,
Shanmugam
> >          http://api.worldbank.org/countries/ago;chn;abw;usa/indicators/CC.EST?...
>
> > Referhttp://data.worldbank.org/node/11for more information about the

Shanmugam Natarajan

unread,
Apr 20, 2012, 4:40:11 PM4/20/12
to World Bank API
Hi Sarven,
This issue has been fixed and now the WGI two letter country codes are
displayed in the result. Please check.

WGI indicator data api call,
http://api.worldbank.org/countries/all/indicators/CC.EST?source=3

Output part:
<wb:data>
<wb:indicator id="CC.EST">Control of Corruption: Estimate</
wb:indicator>
<wb:country id="AI">Anguilla</wb:country>
<wb:date>2009</wb:date>
<wb:value>1.35613654772844</wb:value>
<wb:decimal>0</wb:decimal>
</wb:data>


Thanks,
Shanmugam
> > > Referhttp://data.worldbank.org/node/11formore information about the

Sarven Capadisli

unread,
Apr 21, 2012, 1:18:08 PM4/21/12
to world-b...@googlegroups.com
That's great, thanks!

There is another email thread on units for the indicator measures. Any
chance of that happening? :)

-Sarven

Sarven Capadisli

unread,
Apr 22, 2012, 5:52:31 PM4/22/12
to world-b...@googlegroups.com
On 12-04-20 09:40 PM, Shanmugam Natarajan wrote:
> Hi Sarven,
> This issue has been fixed and now the WGI two letter country codes are
> displayed in the result. Please check.
>
> WGI indicator data api call,
> http://api.worldbank.org/countries/all/indicators/CC.EST?source=3
>
> Output part:
> <wb:data>
> <wb:indicator id="CC.EST">Control of Corruption: Estimate</
> wb:indicator>
> <wb:country id="AI">Anguilla</wb:country>
> <wb:date>2009</wb:date>
> <wb:value>1.35613654772844</wb:value>
> <wb:decimal>0</wb:decimal>
> </wb:data>

Hi Shanmugam,

I forgot to mention that these new codes (and the rest of the
information for the area) should probably be added to the API response
for countries as well.

Thanks,

-Sarven

Shanmugam Natarajan

unread,
Apr 24, 2012, 4:59:30 PM4/24/12
to World Bank API
Thanks for your suggestion. We are working on this to show these
countries in the countries list.

Regards,
Shanmugam
Reply all
Reply to author
Forward
0 new messages