HOW TO USE AFRICAN FINANCIAL & ECONOMIC DATA API


Before we get started you need to register with us and obtain an API key to access our API here.

Your main call will be to the “search-data” API end point which returns economic data for 54 countries, this guide will run you through how to build parameters for this POST call so you can retrieve results which are relevant to you.

This guide will explain how to build each parameter you need to pass to get these results

POST Call: http://api.africadata.com/search-data?api_key=your-api-key-here
Parameter Value Info
country_codes: BW,DZ Comma separated
indicators_ids: 2074,107 Comma separated
frequency_id: 1 1 = Annually, 2 = Monthly, 6= Daily
source_ids: 103,106 Comma separated
sub_source_ids: 5,7 Comma separated
date_start: 2015-01-01 Format: yyyy-mm-dd
date_end: 2015-01-01 Format: yyyy-mm-dd
limit: 10 Limit the results returned we have a hard limit of 1000 records at present
start: 10 Paginated records you start the records from this number

Example:
curl --data "country_codes=AO&indicators_ids=43140,459,47905,47907,51545&frequency_id=1&source_ids=104&sub_source_ids=6,40&date_start=2014-01-01&date_end=2015-12-31" http://api.africadata.com/search-data?api_key= your-api-key-here

GET Call: http://api.africadata.com/countries?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/countries?api_key=your-api-key-here

Parameter Value Info
country_codes: country_code,country_code Pass a comma separated string which made of country_code parameter

Topics & Indicators

Indicators param, this one is a bit more complex, indicators are part of topics in order to get a list of indicators you need to find the parent topic so we can get a list of indicators associated to topic

GET Call: http://api.africadata.com/topics-list?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/topics-list?api_key=your-api-key-here

Now we have our topics list we need topic_cd parameter from returned object to search for topic indicators.

GET Call: http://api.africadata.com/indicators-list/{topic_cd}?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/indicators-list/{topic_cd}?api_key=your-api-key-here

Parameter Value Info
indicators_ids: lbl_id,lbl_id You can pass one or multiple lbl_id comma separated string parameter

Sources are list of organizations which provide data and we collect that data from sources are broken into three categories.
Names are self explanatory.

Local sources

GET Call: http://api.africadata.com/sources-local?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/sources-local?api_key=your-api-key-here

Regional sources

GET Call: http://api.africadata.com/sources-region?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/sources-region?api_key=your-api-key-here

International sources

GET Call: http://api.africadata.com/sources-international?api_key=your-api-key-here

Example:
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://api.africadata.com/sources-international?api_key=your-api-key-here

Parameter Value Info
source_ids: src_id,src_id Pass a comma separated string which is made of src_id parameter
sub_source_ids: sbsrc_id,sbsrc_id Pass a comma separated string which is made of sbsrc_id parameter

If you need further assistance please contact Ilze Gouws or Mohamed Dhouibi.