The API is reachable at the following URL:

The following parameters are available to query and filter the data:

Name Description Is Mandatory Default
TABLE The name of the table to query. Yes -
WHERE Specify the filter to apply by using the SQL syntax. No No filter applied
PAGE Specify a page number to navigate results. Each page will have up to 1000 records. No 0

In order to make a request, all parameters must be passed with a "POST" method.

The tables to query are: pblStatsSum and pblStatsSum4Maps (click here for dictionary of column descriptions).

Example 1 - Simple HTML Form

In this example we will query the API to get all Food Consumption Score (FCS) summary statistics in Yemen from the table pblStatsSum that have a mean score <40.

<form  action="" method="post" target="_blank">
    <input name="table" type="text"  value="pblStatsSum" /><br /><br />
    <input name="where" value="ADM0_NAME = 'Yemen' AND VARIABLE='FCS' AND MEAN < 40" type="text" /><br />
    <input name="page" type="text" /><br /><br />        
    <input type="submit" name="BtnGetJson" value="Get JSON" />

Example 2 - Python post using "HTTP for Humans" library

Same query as in the above example but using a server-side script in Python. This is using the "HTTP for Humans" library in order to easily make a "post" request.

>>> import requests
>>> r ="", data={'table': 'pblStatsSum', 'where': 'ADM0_NAME = \'Yemen\' AND VARIABLE=\'FCS\' AND MEAN < 40', 'page': 0})
>>> print(r.status_code, r.reason)