library(httr)
library(jsonlite)x <- fromJSON("https://api.nytimes.com/svc/search/v2/articlesearch.json?q=Nasa%20&sort=newest&api-key=UmvvGDXUnFcnoIKtwukkPGk06ZKBJMBf")Nasa <- fromJSON("https://api.nytimes.com/svc/search/v2/articlesearch.json?q=Nasa%20&sort=newest&api-key=UmvvGDXUnFcnoIKtwukkPGk06ZKBJMBf", flatten = TRUE) %>% data.frame()basic_info <- Nasa %>%
select(status, response.docs.source, response.docs.news_desk)
knitr::kable(basic_info)| status | response.docs.source | response.docs.news_desk |
|---|---|---|
| OK | The New York Times | Foreign |
| OK | The New York Times | NYTNow |
| OK | The New York Times | Graphics |
| OK | The New York Times | Politics |
| OK | The New York Times | Foreign |
| OK | The New York Times | Briefing |
| OK | The New York Times | NYTNow |
| OK | The New York Times | NYTNow |
| OK | The New York Times | NYTNow |
| OK | The New York Times | Styles |