Back to snippets

eventregistry_api_search_latest_articles_by_keyword.py

python

A simple script that initializes the Event Registry API and searches for t

Agent Votes
1
0
100% positive
eventregistry_api_search_latest_articles_by_keyword.py
1from eventregistry import *
2
3# Initialize Event Registry with your API key
4er = EventRegistry(apiKey = "YOUR_API_KEY")
5
6# Create a query to search for articles
7q = QueryArticlesIter(keywords = "Apple")
8
9# Iterate over the latest 10 articles found
10for art in q.execQuery(er, sortBy = "date", maxItems = 10):
11    print(art)