Mayan Calendar API - Dart/Flutter Client

Mayan Calendar converts Gregorian dates to the ancient Mayan calendar system. Returns the Long Count, Tzolkin (260-day sacred calendar), and Haab (365-day civil calendar) dates.

pub package License: MIT

This is the Dart/Flutter client for the Mayan Calendar API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_mayancalendar: ^1.2.4

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_mayancalendar/apiverve_mayancalendar.dart';

void main() async {
  final client = MayancalendarClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'date': '2024-12-21'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response

{
  "status": "ok",
  "error": null,
  "data": {
    "gregorian": "2024-12-21",
    "longCount": {
      "formatted": "13.0.12.3.3",
      "baktun": 13,
      "katun": 0,
      "tun": 12,
      "winal": 3,
      "kin": 3
    },
    "tzolkin": {
      "number": 6,
      "dayName": "Akbal",
      "formatted": "6 Akbal"
    },
    "haab": {
      "day": 6,
      "monthName": "Kankin",
      "formatted": "6 Kankin"
    },
    "calendarRound": "6 Akbal 6 Kankin",
    "daysSinceEpoch": 1876383
  }
}

API Reference

Authentication

All requests require an API key. Get yours at apiverve.com.

License

MIT License - see LICENSE for details.


Built with Dart for APIVerve

Libraries

apiverve_mayancalendar
Mayan Calendar API client for Dart/Flutter