The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Dissemination and Capacity Strengthening » Application Programming Interface (API)  » API list of surveys with GPS datasets is incomplete (API list of surveys with GPS datasets is incomplete)
API list of surveys with GPS datasets is incomplete [message #30411] Mon, 25 November 2024 10:03 Go to next message
DiegoBassani is currently offline  DiegoBassani
Messages: 6
Registered: July 2019
Member
Hi, I noticed the following API request:

https://api.dhsprogram.com/rest/dhs/surveys?surveyCharacteri sticIds=26&surveyStatus=completed&surveytype=DHS& ;f=html

Excludes some surveys that have GPS datasets (surveyCharacteristicIds=26), for example, Cambodia 2021, Jordan 2017, Mali 2018, Nigeria 2018, Philippines 2017 and Tajikistan 2017 all have GPS datasets, but do not show up in this API call because code 26 is not in their "surveyCharacteristicIds" column.

they do show as available in the datasets query, although not clear how to filter the API call. https://api.dhsprogram.com/rest/dhs/datasets?DatasetType=GPS Datasets&f=html


1887 KHGC81FL.ZIP Cambodia 2021 2021-22 DHS KH 558 KH2021DHS GPS Datasets Geospatial Covariates Flat ASCII data (.dat) 846214 2023-02-20 15:31:12.0
1888 KHGE81FL.ZIP Cambodia 2021 2021-22 DHS KH 558 KH2021DHS GPS Datasets Geographic Data Flat ASCII data (.dat) 76915 2023-02-20 08:24:32.0


Thanks

Diego

Re: API list of surveys with GPS datasets is incomplete [message #30413 is a reply to message #30411] Mon, 25 November 2024 14:48 Go to previous messageGo to next message
Blake-DHS is currently offline  Blake-DHS
Messages: 2
Registered: March 2022
Member
Diego

Thank you for flagging this issue. There were 17 surveys with a missing survey characteristic 'GPS/georeferenced'. They have all been updated in our database and are listed below. To filter the API call for georeferenced datasets, use this link https://api.dhsprogram.com/rest/dhs/datasets/?fileType=GE&am p;f=html

Albania 2017-18 DHS
Bangladesh 2017 SPA
Bangladesh 2017-18 DHS
Burkina Faso 2017-18 MIS
Cambodia 2021-22 DHS
Ethiopia 2021-22 SPA
Ghana 2016 MIS
Jordan 2017-18 DHS
Malawi 2017 MIS
Mali 2018 DHS
Mozambique 2018 MIS
Nepal 2021 SPA
Nigeria 2018 DHS
Philippines 2017 DHS
Senegal 2017 SPA
Tajikistan 2017 DHS
Togo 2017 MIS

Blake Zachary
The DHS Program
Re: API list of surveys with GPS datasets is incomplete [message #30441 is a reply to message #30413] Sat, 30 November 2024 20:25 Go to previous messageGo to next message
DiegoBassani is currently offline  DiegoBassani
Messages: 6
Registered: July 2019
Member
Thanks Blake,

The call by surveyCharacteristicIds=26 still does not bring up the same list as the one by fileType=GE.

https://api.dhsprogram.com/rest/dhs/surveys?fileType=GE& surveyStatus=completed&surveytype=DHS&f=html (328 records)

https://api.dhsprogram.com/rest/dhs/surveys?surveyCharacteri sticIds=26&surveyStatus=completed&surveytype=DHS& ;f=html (198 records)

If I remove the survey status query, the numbers are still different, and smaller (not what I would expect with a less restrictive query).

https://api.dhsprogram.com/rest/dhs/surveys?fileType=GE& surveytype=DHS&f=html (313 records)

https://api.dhsprogram.com/rest/dhs/surveys?surveyCharacteri sticIds=26&surveytype=DHS&f=html (193 records)

Diego
Re: API list of surveys with GPS datasets is incomplete [message #30468 is a reply to message #30441] Wed, 04 December 2024 09:47 Go to previous message
Blake-DHS is currently offline  Blake-DHS
Messages: 2
Registered: March 2022
Member
You cannot specify a fileType in a surveys call, only in a datasets call. Below is the correct call for each.

https://api.dhsprogram.com/rest/dhs/surveys?surveyCharacteri sticIds=26&surveyStatus=completed&f=html
https://api.dhsprogram.com/rest/dhs/datasets/?fileType=GE&am p;surveyStatus=completed&f=html

The number of surveys with GPS data collected will not match the number of geospatial datasets available because not all GPS data collected is publicly released for various reasons.

https://dhsprogram.com/data/available-datasets.cfm

If the surveyStatus is not specified, the default is surveys with data available in the API. Not all completed surveys have data in the API which is why the total would be less. Pending surveys also do not have data in the API until they are marked as completed.


Blake Zachary, The DHS Program
Previous Topic: How to web scrape data on python from the DHS program API
Next Topic: Relative standard errors and design effects across surveys
Goto Forum:
  


Current Time: Thu Dec 12 11:29:52 Coordinated Universal Time 2024