Skip to content

Instantly share code, notes, and snippets.

View HuangRicky's full-sized avatar

Ricky Huang HuangRicky

  • New York, NY, USA
View GitHub Profile
@HuangRicky
HuangRicky / ACLED_web_api.R
Created January 19, 2017 22:53
ACLED API Calls in R
library(httr)
library(dplyr)
ACLED_call <- function(query="") {
url <- paste0("http://acleddata.com/api/acled/read", query)
resp <- GET(url)
if (http_type(resp) != "application/json") {
stop("API did not return json", call. = FALSE)
}