Topic feeds from a single query
Every article is categorized when it is collected, and tagged with the people, organizations and places it mentions. A section of your app becomes a single query.
Combine categories with languages, source countries and source ranking to shape each feed for its audience.
- News categories such as news/Sports work across languages
- Filter by language and by the country of the source
- Sort by date, relevance or source importance
# the sports section of a German-language app
q = QueryArticlesIter(
categoryUri = "news/Sports",
lang = "deu",
sourceLocationUri = er.getLocationUri("Germany"),
isDuplicateFilter = "skipDuplicates")
for art in q.execQuery(er, sortBy = "date", maxItems = 30):
print(art["title"], art["image"], art["url"])
const api = "https://eventregistry.org/api/v1";
const response = await fetch(api + "/article/getArticles", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"apiKey": "YOUR_API_KEY",
"categoryUri": "news/Sports",
"lang": "deu",
"sourceLocationUri": "http://en.wikipedia.org/wiki/Germany",
"isDuplicateFilter": "skipDuplicates",
"resultType": "articles",
"articlesSortBy": "date",
"articlesCount": 30
}),
});
const data = await response.json();
for (const art of data.articles.results) {
console.log(art.title, art.image, art.url);
}
curl -X POST "https://eventregistry.org/api/v1/article/getArticles" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_API_KEY",
"categoryUri": "news/Sports",
"lang": "deu",
"sourceLocationUri": "http://en.wikipedia.org/wiki/Germany",
"isDuplicateFilter": "skipDuplicates",
"resultType": "articles",
"articlesSortBy": "date",
"articlesCount": 30
}'
POST https://eventregistry.org/api/v1/article/getArticles
Content-Type: application/json
{
"apiKey": "YOUR_API_KEY",
"categoryUri": "news/Sports",
"lang": "deu",
"sourceLocationUri": "http://en.wikipedia.org/wiki/Germany",
"isDuplicateFilter": "skipDuplicates",
"resultType": "articles",
"articlesSortBy": "date",
"articlesCount": 30
}
Comes back with
titleimageurlsourcedateTime