Skip to content

Commit

Permalink
Add Tags (#78)
Browse files Browse the repository at this point in the history
* Add tags.

* Update example & lint.
  • Loading branch information
westy92 authored Oct 16, 2023
1 parent 5065af2 commit 62a76f8
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 168 deletions.
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,35 @@

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

# Authentication
## Authentication

Access to the Holiday and Event API requires an API Key. You can get for one for FREE [here](https://apilayer.com/marketplace/checkiday-api#pricing), no credit card required! Note that free plans are limited. To access more data and have more requests, a paid plan is required.

# Installation
## Installation

```console
$ npm install --save holiday-event-api
npm install --save holiday-event-api
```

# Example Usage
## Example Usage

### Authentication

## Authentication
Simply construct an instance of `Holidays` and pass your API Key like this:

```ts
import { Holidays } from 'holiday-event-api';

// Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
const api = new Holidays({ apiKey: '<Your API Key Here>' });
```

## Example Project
### Example Project

You can find a fully-functioning example project [here](example).

## Get Events
### Get Events

Get all events for a specified date.

```ts
Expand All @@ -49,6 +54,7 @@ const response = await api.getEvents({
```

Example response (some events removed to save space):

```json
{
"timezone": "America/New_York",
Expand Down Expand Up @@ -92,7 +98,8 @@ Example response (some events removed to save space):
}
```

## Search For Events
### Search For Events

Search for events with a specified query.

```ts
Expand All @@ -106,6 +113,7 @@ const response = await api.search({
```

Example response:

```json
{
"query": "zucchini",
Expand Down Expand Up @@ -134,7 +142,8 @@ Example response:
}
```

## Get Event Information
### Get Event Information

Get additional information for an Event.

```ts
Expand All @@ -151,6 +160,7 @@ const response = await api.getEventInfo({
```

Example response (some strings shortened to save space):

```json
{
"event": {
Expand Down Expand Up @@ -199,6 +209,11 @@ Example response (some strings shortened to save space):
"length": 1
}
],
"tags": [
{
"name": "Pets & Animals"
}
],
"occurrences": [
{
"date": "08/08/2002",
Expand Down
Loading

0 comments on commit 62a76f8

Please sign in to comment.