The `eventregistry` library is a Python client for interacting with the Event Registry API (eventregistry.org). It allows users to query for news articles, events, mentions, and perform text analytics. The current version is 9.1, and releases are made periodically to add new features and improve existing functionality.
pip install eventregistryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `EventRegistry` client with an API key, construct a `QueryArticles` object to search for articles, execute the query, and print the titles of the retrieved articles. Ensure your API key is correctly set.
Upgrade your Python environment to version 3.5 or higher. If you need Python 2.x or older 3.x compatibility, pin `eventregistry` to a version less than 9.0 (e.g., `eventregistry==8.10`).
Obtain an API key from eventregistry.org and pass it to the `EventRegistry` constructor, e.g., `EventRegistry(apiKey='YOUR_API_KEY')`. It's recommended to use environment variables for keys.
Implement explicit error handling for `eventregistry.EventRegistryException` or other `requests.exceptions.RequestException` in your code to gracefully manage API errors and invalid requests.
When constructing queries, use `keywordSearchMode='OR'` or `keywordSearchMode='AND'` along with your keywords. Refer to the documentation for advanced usage examples.
Double-check your API key on eventregistry.org. Generate a new key if necessary, and ensure it's correctly passed to the `EventRegistry` constructor.
Consult the documentation or examples for the specific query class you are using and ensure all mandatory parameters are supplied during initialization. For `QueryArticles`, at least `keywords`, `conceptUri`, or `sourceUri` is usually needed.
Verify the import statement is exactly `from eventregistry import EventRegistry`. If the error persists, try reinstalling the library: `pip install --upgrade eventregistry`.
Install the library using pip: `pip install eventregistry`. Ensure you are running this command in the same environment where your Python script will execute.
No dependency data recorded yet.