Repository navigation
v11.0 (2026-10-14)
See the migration guide for how to update your code.
Breaking changes
- the package requires Python 3.9 or newer.
- removed
GetTopSharedArticlesandGetTopSharedEvents(theDailySharesmodule). The data about the shares on social media is no longer collected and the server ignores sorting by the social score, so they only returned the content of the given day in no particular order. - removed the
RequestMentionsConceptGraphresult type. It was never supported by the server (the request returned anunrecognized resultTypeerror). from eventregistry import *now imports only the public classes, functions and constants of the package (each module defines__all__). Before, it also imported the modules that the package uses itself (datetime,json,os,time,re,requests, ...), which could overwrite names in your code (for exampledatetimeimported withfrom datetime import datetime). Scripts that relied on getting these modules from the package have to import them themselves, e.g.import datetime.- the iterator classes (
QueryArticlesIter,QueryEventsIter,QueryMentionsIter,QueryEventArticlesIter) raise aQueryErrorwhen the server returns an error, both while iterating and incount(). Before, the error was only logged and the iteration ended as if there were no (more) results, andcount()returned 0. execQuery()of the iterator classes no longer accepts arbitrary keyword arguments - they were silently ignored, so a misspelled argument (e.g.sortby) had no effect.RequestEventArticlesno longer accepts them either. A misspelled argument now raises aTypeError.- the
*InfoFlagsclasses raise aTypeErrorfor an argument that differs from a known one only in the letter case (e.g.bodylen) and log a warning for other unknown arguments (they are still sent to the server), except for the full names of the API parameters (starting withinclude). - the package no longer configures the logging: it does not add a handler to the
eventregistrylogger and ignores theLOGLEVELenvironment variable. Warnings and errors are still printed by default; use theloggingmodule to change the level or the output. - datetimes with a timezone are sent as UTC without the offset (
2026-10-02T04:30:00instead of2026-10-02T04:30:00+00:00).
Changed
execQuery()of the iterator classes returns a separate iterator object (QueryResultsIter) instead of the query itself. The query is not changed by iterating, so it can be executed again or iterated several times at once. Iterating over the query object after callingexecQuery()still works.- the sort options
socialScore,facebookShares,twitterSharesandidwere removed from the documentation, since the server ignores them (the data about the shares on social media is no longer collected): withsocialScoreandfacebookSharesthe results are returned unsorted, with the other two they are sorted by date. A warning is logged when one of them is used. - the docstrings were converted from the epydoc format (
@param name:) to the Google style (Args:/Returns:), which IDEs and documentation tools understand. - the examples in
eventregistry/examplesare now functions that can be run individually (python QueryArticlesExamples.pylists them,python QueryArticlesExamples.py <name>runs one). Running or importing an example file no longer makes any requests by itself.examples/QueryMentions.pywas renamed toQueryMentionsExamples.py. - packaging moved to
pyproject.toml; the tests are run and the API reference is built by GitHub Actions. The tests that make requests to the live API are no longer part of the repository - it contains the tests that run without an API key. EventRegistry.execQuery()has a newraiseOnErrorparameter: if True, aQueryErroris raised when the server returns an error.- failed requests now raise typed exceptions that derive from the new
EventRegistryError(and still fromException):NoDataError(204),InvalidRequestError(400 and other 4xx),UnauthorizedError(401) andForbiddenError(403) (bothAccessError),RateLimitError(429),ServerError(5xx),InvalidResponseError(invalid json) andNetworkError(connection problems and timeouts). The exceptions carrystatusCode,responseText,urlandretryAfter. - the default
repeatFailedRequestCountchanged from -1 (repeat indefinitely) to 3. Use -1 to get the old behavior. - only temporary errors (429, 5xx, invalid json, connection problems, timeouts) are repeated. Before, every status code except 204, 400, 401 and 403 was repeated, e.g. 404 and 422. Requests rejected with 429 (too many simultaneous requests) are repeated until they succeed, regardless of
repeatFailedRequestCount, so an iteration over the results is not interrupted by them. - the delay before repeating a request grows exponentially (2, 4, 8, ... seconds, at most 60) instead of a fixed 5 seconds, and follows the server's
Retry-Afterheader when present. There is no more delay after the last failed attempt. - the requests of other threads are no longer blocked while a failed request waits to be repeated.
jsonRequest()andjsonRequestAnalytics()share the same request code, so analytics requests now also raise the typed exceptions.
Fixed
- wrong type hints: the
suggest*()methods return a list (not a dict),jsonRequest()can return a list or a dict, and thesourceLocationUri,sourceGroupUriandauthorUriparameters ofBaseQueryaccept a string orQueryItems(a plain list was annotated, but raises aTypeError). The package now passesmypy. QueryMentions.initWithComplexQuery()andQueryMentionsIter.initWithComplexQuery()rejected aComplexMentionQueryinstance (only a dict or a JSON string worked), andQueryMentionsIter.initWithMentionUriList()rejected a single uri given as a string.QueryEventssent the keywords to ignore asignoreKeywordsinstead ofignoreKeyword, the name used by the article and mention queries.QueryEventArticlesIterreplaced theQueryItems.OR()/QueryItems.AND()operators of the conditions (concepts, categories, sources, authors) with the default ones when requesting the articles, and logged a wrong warning about a list used without an operator.import eventregistryfailed withValueError: Unknown levelwhen theLOGLEVELenvironment variable was set to a lowercase value.TopicPage.getArticles()andgetEvents()raised aKeyErrorafterloadTopicPageFromDefinition()orloadTopicPageFromFile()with a definition that did not contain all the properties. The definition is now merged with the default values.- an empty list (or an empty
QueryItems) given as a condition was sent to the server instead of being ignored. encodeDate()used the local date of a datetime with a timezone instead of its date in UTC, andencodeDateTime()rejected strings withZor a timezone offset.- with
verboseOutput=Truethe API key (and the credentials in aproxyUrl) were written to the log. They are now masked.
Added
- new result types for article searches:
RequestArticlesLangAggr(number of articles per language),RequestArticlesSentimentAggr(distribution of the sentiment),RequestArticlesAuthorAggr(top authors),RequestArticlesLocAggr(locations of the reported events) andRequestArticlesSourceExAggr(top sources with their article counts over time). - new result types for event searches:
RequestEventsSentimentAggrandRequestEventsAuthorAggr. - new result type for mention searches:
RequestMentionsEventTypeAggr(the event types of the mentions with their counts). TopicPage.getArticles()andgetEvents()have the new parametersuri(get the content of a topic page saved in your account without loading its definition),onlyAfterTm(only the content added after the given time - useful for polling for new content) andmaxDaysBack.GetRecentArticlesandGetRecentEventsaccept the conditions as named parameters (keywords,conceptUri,categoryUri,sourceUri,sourceLocationUri,sourceGroupUri,authorUri,locationUri,lang, ...), together withmaxArticleCount/maxEventCount,updatesAfterMinsAgoandupdatesAfterTm. Before, they could only be passed as raw API parameters.- the API key can be provided with the
EVENTREGISTRY_API_KEYenvironment variable. It is used when theapiKeyargument is not given, before looking into the settings file. BaseQuery(used inComplexArticleQuery,ComplexEventQueryandComplexMentionQuery) has thekeywordSearchModeparameter.- the package is distributed with type information (
py.typed), so type checkers use its type hints. - an API reference generated from the docstrings: https://eventregistry.github.io/event-registry-python/
repr()of a query shows its parameters and requested result types, e.g.QueryArticles(action='getArticles', keyword='Tesla', resultType=['articles']).