I am trying to automate loading part of the data from the API of this government website .
The website instructs:
All requests for this version should be made to the following URL:
http://api.finder.healthcare.gov/v2.0/
I can find lots of information on how to send the xml, but none of the examples is not R-specific .. and there are many R-code that shows how to use XML, httrand RCurl, but I could not find any examples in the SO or r-help mailing list on how to send an xml request ... there is more documentation for parsing the response.
on the government website , if you click on an example PlansForIndividualOrFamily Samples, it will display the xml request (code below) that needs to be sent.
url <- "http://api.finder.healthcare.gov/v2.0/"
xml.request <-
"<?xml version='1.0' encoding='UTF-8'?>
<PrivateOptionsAPIRequest>
<PlansForIndividualOrFamilyRequest>
<Enrollees>
<Primary>
<DateOfBirth>1990-01-01</DateOfBirth>
<Gender>Male</Gender>
<TobaccoUser>Smoker</TobaccoUser>
</Primary>
</Enrollees>
<Location>
<ZipCode>69201</ZipCode>
<County>
<CountyName>CHERRY</CountyName>
<StateCode>NE</StateCode>
</County>
</Location>
<InsuranceEffectiveDate>2012-10-01</InsuranceEffectiveDate>
<IsFilterAnalysisRequiredIndicator>false</IsFilterAnalysisRequiredIndicator>
<PaginationInformation>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
</PaginationInformation>
<SortOrder>
<SortField>OOP LIMIT - INDIVIDUAL - IN NETWORK</SortField>
<SortDirection>ASC</SortDirection>
</SortOrder>
<Filter/>
</PlansForIndividualOrFamilyRequest>
</PrivateOptionsAPIRequest>"
source
share