You should really try to switch to httr as it makes all the web calls much cleaner (and the API docs say the date params go in the query part):
library(httr)
c_in <- '08/02/2015'
c_out <- '08/05/2015'
hotwire_api_url <- "http://api.hotwire.com/v1/deal/hotel"
res <- GET(hotwire_api_url,
query=list(dest="chicago",
apikey="########",
format="JSON",
limit=50,
startdate=c_in,
enddate=c_out))
# since return val is "text/x-json"
recs <- jsonlite::fromJSON(content(res, as="text"))
head(recs$Result)
## FoundDate CurrencyCode NightDuration EndDate
## 1 2015-08-01T23:38:48-07:00 USD 3.0 08/05/2015
## 2 2015-08-01T23:38:04-07:00 USD 3.0 08/05/2015
## 3 2015-08-01T23:38:47-07:00 USD 3.0 08/05/2015
## 4 2015-08-01T23:38:48-07:00 USD 3.0 08/05/2015
## 5 2015-08-01T23:38:36-07:00 USD 3.0 08/05/2015
## 6 2015-08-01T23:38:18-07:00 USD 3.0 08/05/2015
## Headline IsWeekendStay Price StartDate
## 1 Naperville 5 Star Hotel, $143/night false 143.0 08/02/2015
## 2 Northbrook 4 Star Hotel, $67/night false 67.0 08/02/2015
## 3 Chicago 4.5 Star Hotel, $208/night false 208.0 08/02/2015
## 4 Schiller Park 4 Star Hotel, $140/night false 140.0 08/02/2015
## 5 Chicago 4.5 Star Hotel, $142/night false 142.0 08/02/2015
## 6 Naperville 4 Star Hotel, $98/night false 98.0 08/02/2015
## Url
## 1 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjE4NTAzOjE0MDUwOjUuMDoxNDMuMDpZOlk6WQ--&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## 2 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjM1MTEwOjg3NTQ3OjQuMDo2Ny4wOlk6WTpZ&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## 3 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjQ4Njk6ODc1NDU6NC41OjIwOC4wMDAwMjpZOlk6WQ--&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## 4 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjM1MTI3Ojg5ODg5OjQuMDoxNDAuMDpZOlk6WQ--&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## 5 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjQ4Njk6ODc5NTE6NC41OjE0Mi4wOlk6WTpZ&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## 6 http://www.hotwire.com/hotel/superPage.jsp?encDealHash=MTAwOjE4NTAzOjE0MDUwOjQuMDo5OC4wOlk6WTpZ&rs=20500&xid=x-103&wid=w-3&rid=r-69820702248&startDate=08/02/2015&endDate=08/05/2015&bid=B311402&sid=S298
## City CountryCode NeighborhoodLatitude NeighborhoodLongitude
## 1 Naperville US 41.8008 -88.1328
## 2 Northbrook US 42.1138 -87.8601
## 3 Chicago US 41.8989 -87.6243
## 4 Schiller Park US 41.9334 -87.9029
## 5 Chicago US 41.8549 -87.6221
## 6 Naperville US 41.8008 -88.1328
## Neighborhood StarRating StateCode
## 1 Lisle - Naperville 5.0 IL
## 2 Northbrook - Glenview - Mt. Prospect 4.0 IL
## 3 Magnificent Mile North - Water Tower 4.5 IL
## 4 O'Hare Intl Airport ORD South 4.0 IL
## 5 McCormick Place - South Loop - Soldier Field 4.5 IL
## 6 Lisle - Naperville 4.0 IL
c_inandc_out? Are they variables defined in your global environment?paste0()to build the URL for the call togetURL()with the dates based onc_inandc_out, likegetURL(paste0("http://api.hotwire.com/v1/deal/hotel?dest=chicago&apikey=##############&format=JSON&limit=50&startdate=", c_in, "&enddate=", c_out))?