The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Dissemination and Capacity Strengthening » Application Programming Interface (API)  » Source of contraception by method
Source of contraception by method [message #24298] Fri, 15 April 2022 14:43 Go to next message
DHSuser_NY is currently offline  DHSuser_NY
Messages: 8
Registered: November 2019
Member
Good afternoon,

Is there a way to extract source of family planning for each method using API?


Thanks,
DHsuser_NY
Re: Source of contraception by method [message #24308 is a reply to message #24298] Fri, 15 April 2022 16:31 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 787
Registered: January 2013
Senior Member
Yes, here are a couple of calls to the API that will return the source by method. There are a lot of separate indicators for the source, so the list gets long and browsers don't like calls of over 250 characters, so I have split the calls into a couple of different calls:

For public sources:
https://api.dhsprogram.com/rest/dhs/data/FP_SRCM_W_PUB,FP_SR CM_W_GHS,FP_SRCM_W_GHC,FP_SRCM_W_GFP,FP_SRCM_W_GMB,FP_SRCM_W _GFW,FP_SRCM_W_GOT?f=html&breakdown=all
and for private and other sources:
https://api.dhsprogram.com/rest/dhs/data/FP_SRCM_W_PRV,FP_SR CM_W_PHS,FP_SRCM_W_PPH,FP_SRCM_W_PDR,FP_SRCM_W_PMB,FP_SRCM_W _PFW,FP_SRCM_W_POT,FP_SRCM_W_OSR,FP_SRCM_W_SHP,FP_SRCM_W_CHH ,FP_SRCM_W_FRR,FP_SRCM_W_OTH?f=html&breakdown=all

The breakdown=all parameter for these indicators breaks the data down by method.
Previous Topic: Generate percent of respondents by background characteristics
Next Topic: Maternal and child health indicators by background characteristics
Goto Forum:
  


Current Time: Thu Mar 28 19:56:54 Coordinated Universal Time 2024