Hi there,
I'm trying to use the FBI's crime API for law enforcement agency level crime stats
https://crime-data-explorer.fr.cloud.gov/api
The instructions imply that I can use the API to download all stats for a certain crime, in one state, and in a given year range at once, but I am running into a problem where I can only get the first 20 agencies for any query that I attempt.
I've tried accessing through the httr package
for example
library(httr)
crime_test <- GET("https://api.usa.gov/crime/fbi/sapi/api/summarized/state/AL/homicide/2000/2010?API_KEY=rXkYttHIBtz7kMBg4moX9LjEKyrp9GtwLyCR8gfg")
crime_text <- content(crime_test, "text")
crime_json <- fromJSON(crime_text, flatten=TRUE)
crime_df <- as.data.frame(crime_json)
but this only returns 20 entries for every state that I try.
When I try using the web app I run into the same problem
https://api.usa.gov/crime/fbi/sapi/api/summarized/state/AL/homicide/2010/2017?API_KEY=iiHnOKfno2Mgkt5AynpvPpUQTEyxE77jo1RU8PIv
it returns 20 entries and at the bottom of the page reads
"pagination" : {
"count" : 2973,
"page" : 0,
"pages" : 149,
"per_page" : 20
}
Any help SO appreciated. Thank you!!