The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Dissemination and Capacity Strengthening » Application Programming Interface (API)  » How to use API to import data to R/Stata
Re: How to use API to import data to R/Stata [message #23050 is a reply to message #23049] Thu, 01 July 2021 14:43 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 799
Registered: January 2013
Senior Member
The API is not designed for loading datasets into R or Stata. The API is used to provide aggregated indicator data to tools such as STATcompiler or the DHS mobile app. It can also be used to download aggregated data (not the micro data) in Stata or R, or other tools. You can find out about the API at There are some code samples on the API site for using the API in R or Stata.

However, there is a tool called rdhs developed by Oliver Watson and Jeff Eaton that does permit downloading and using DHS datasets directly in R, and this makes use of the API to find information about the datasets and about indicators. This also includes a number of vignettes about how to use rdhs, including an introduction vignette.
Read Message
Read Message
Previous Topic: is "perpage" query param supported for data API?
Next Topic: Child health data
Goto Forum:

Current Time: Thu Jun 13 13:18:12 Coordinated Universal Time 2024