Skip to main content

The Official Holiday and Event API for Python

PyPI Supported Versions Build Status Code Coverage Known Vulnerabilities Funding Status

Industry-leading Holiday and Event API for Python. Over 5,000 holidays and thousands of descriptions. Trusted by the World’s leading companies. Built by developers for developers since 2011.

Supported Python Versions

Latest version of the the Holiday and Event API supports all actively-maintained Python releases and might work with older versions. It also supports PyPy versions 3.7, 3.8, and 3.9.

Authentication

Access to the Holiday and Event API requires an API Key. You can get for one for FREE here, no credit card required! Note that free plans are limited. To access more data and have more requests, a paid plan is required.

Installation

The Holiday and Event API is available on PyPI:

$ python -m pip install holiday-event-api

Example

import holidays


try:
    # Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
    client = holidays.client('<Your API Key Here>')

    # Get Events for a given Date
    events = client.getEvents(
        # These parameters are the defaults but can be specified:
        # date='today',
        # timezone='America/Chicago',
        # adult=False,
    )

    event = events.events[0]
    print(f"Today is {event.name}! Find more information at: {event.url}.")
    print(f"Rate limits remaining: {events.rateLimit.remainingMonth}/{events.rateLimit.limitMonth} (month).")

    # Get Event Information
    eventInfo = client.getEventInfo(
        id=event.id,
        # These parameters can be specified to calculate the range of eventInfo.Event.Occurrences
        # start=2020,
        # end=2030,
    )

    print(f"The Event's hashtags are {eventInfo.event.hashtags}.")

    # Search for Events
    query = "pizza day"
    search = client.search(
        query=query,
        # These parameters are the defaults but can be specified:
        # adult=False,
    )

    print(f"Found {len(search.events)} events, including {search.events[0].name}, that match the query '{query}'.")
except Exception as e:
    print(f"There was an error: {e}")

Metadata

Release files for holiday-event-api 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for holiday-event-api 1.0.1
File Size Uploaded
holiday-event-api-1.0.1.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for holiday-event-api 1.0.1
File Interpreter ABI Platform
holiday_event_api-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / holiday-event-api-1.0.1.tar.gz

Download URL holiday-event-api-1.0.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd409d5f37b05c7a76a31f68a65c731f1390156d257eb6754ee2f09f1d38ef0c
BLAKE2b-256 checksum
How to use checksums
4df87285a652ec9576726db505db663d988c4c82f88c7e11c667a76d52e99dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / holiday_event_api-1.0.1-py3-none-any.whl

Download URL holiday_event_api-1.0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59836507b7eb790ad1da91078f12f97ee5c69faaeae17c25eaccf091e8c2c882
BLAKE2b-256 checksum
How to use checksums
0c61be6ede1480d9f861750207114208cefbe57cb09abea12783d1ef7b4d629d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page