https://github.com/westy92/holiday-event-api-dart
The Official Holiday and Event API for Dart and Flutter
https://github.com/westy92/holiday-event-api-dart
api api-client best calendar checkiday dart dartlang event events federal flutter free holiday holiday-api holiday-calculation holidayapi holidays holidays-api list public
Last synced: 5 months ago
JSON representation
The Official Holiday and Event API for Dart and Flutter
- Host: GitHub
- URL: https://github.com/westy92/holiday-event-api-dart
- Owner: westy92
- License: mit
- Created: 2022-12-31T17:19:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-26T13:36:39.000Z (about 1 year ago)
- Last Synced: 2025-03-30T13:04:28.692Z (6 months ago)
- Topics: api, api-client, best, calendar, checkiday, dart, dartlang, event, events, federal, flutter, free, holiday, holiday-api, holiday-calculation, holidayapi, holidays, holidays-api, list, public
- Language: Dart
- Homepage: https://pub.dev/packages/holiday_event_api
- Size: 70.3 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# The Official Holiday and Event API for Dart and Flutter
[](https://pub.dev/packages/holiday_event_api/score)
[](https://pub.dev/packages/holiday_event_api)
[](https://github.com/westy92/holiday-event-api-dart/actions)
[](https://codecov.io/gh/westy92/holiday-event-api-dart)
[](https://github.com/sponsors/westy92)Industry-leading Holiday and Event API for Dart and Flutter. Over 5,000 holidays and thousands of descriptions. Trusted by the World’s leading companies. Built by developers for developers since 2011.
## Supported Dart and Flutter Versions
The latest version of the the Holiday and Event API is compatible with the [latest version of Dart](https://dart.dev/) but should work with 2.15.0 and later.
## 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
The recommended way to install the Holiday and Event API is through [Pub](https://pub.dev/).
```bash
flutter pub add holiday_event_api
```or
```bash
dart pub add holiday_event_api
```## Example
```dart
import 'package:holiday_event_api/holiday_event_api.dart';void main() async {
try {
// Get a FREE API key from https://apilayer.com/marketplace/checkiday-api#pricing
final client = HolidayEventApi('');// Get Events for a given Date
final events = await client.getEvents(
// These parameters are the defaults but can be specified:
// date: 'today',
// timezone: 'America/Chicago',
// adult: false,
);final event = events.events[0];
print("Today is ${event.name}! Find more information at: ${event.url}.");
print(
"Rate limit remaining: ${events.rateLimit.remainingMonth}/${events.rateLimit.limitMonth} (month).");// Get Event Information
final eventInfo = await client.getEventInfo(
id: event.id,
// These parameters can be specified to calculate the range of eventInfo.event.occurrences
// start: 2020,
// end: 2030,
);print("The Event's hashtags are ${eventInfo.event.hashtags}.");
// Search for Events
final query = 'zucchini';
final search = await client.search(
query: query,
// These parameters are the defaults but can be specified:
// adult: false,
);print(
"Found ${search.events.length} events, including '${search.events[0].name}', that match the query '$query'.");
} catch (e) {
print(e);
}
}```
## License
The Holiday and Event API is made available under the MIT License (MIT). Please see the [License File](LICENSE) for more information.