Giter Site home page Giter Site logo

westy92 / holiday-event-api-java Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 93 KB

The Official Holiday and Event API for Java and Kotlin

Home Page: https://search.maven.org/artifact/com.westy92.holiday-event-api/holiday-event-api

License: MIT License

Kotlin 100.00%
checkiday holiday holiday-api holiday-calculation holidayapi holidays holidays-api java jvm kotlin

holiday-event-api-java's Introduction

The Official Holiday and Event API for Java and Kotlin

Maven Central Build Status Code Coverage Funding Status

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

Supported Java Versions

Latest version of the the Holiday and Event API supports all currently-supported Java releases and is also fully compatible with Kotlin.

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

implementation("com.westy92.holiday-event-api:holiday-event-api:1.0.0")

Example

try {
    // Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
    val client = Client("<your API key>")

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

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

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

    println("The Event's hashtags are ${eventInfo.event.hashtags}.")

    // Search for Events
    val query = "zucchini"
    val search = client.search(
        query = query,
        // These parameters are the defaults but can be specified:
        // adult = false,
    )

    println("Found ${search.events.size} events, including '${search.events[0].name}', that match the query '${query}'.")
} catch (e: Exception) {
    println(e)
}

holiday-event-api-java's People

Contributors

dependabot[bot] avatar westy92 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

holiday-event-api-java's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.