Skip to content

Bitcoin-Calendar/calendar-api-db

Repository files navigation

⚡️zapmeacoffee

Bitcoin Historical Events API & SQLite Database

This project provides a Go-based API server to access historical Bitcoin events stored in SQLite databases. It supports multiple languages for event data.

Project Overview

  • API Server (main.go): A Fiber-based Go application that serves event data.
    • Supports language selection via the lang query parameter (e.g., lang=en, lang=ru).
    • Connects to events.db (for English, default) and events_ru.db (for Russian).
    • Requires an API key (X-API-KEY header) for authentication.
    • Uses environment variables for configuration (API key, database paths, port).
  • Databases (data/events.db, data/events_ru.db): SQLite files containing event information.
    • Schema managed by GORM (see database.go).
  • Docker Support: Includes a Dockerfile and docker-compose.yml for containerized deployment.

Key Features

  • Paginated event listings.
  • Filtering events by month/day.
  • Fetching individual events by ID.
  • Listing unique event tags and their counts.
  • Fetching events by specific tags.
  • Language support for event content (English and Russian).
  • Rate limiting and API key authentication.

Documentation

Detailed documentation for the API, database schema, and deployment can be found in the /docs directory:

  • docs/APIDocumentation.md
  • docs/DatabaseDocumentation.md
  • docs/Deployment.md

Setup and Running

Refer to docs/Deployment.md for instructions on building and running the API using Docker.

Environment Variables

The API server uses the following environment variables:

  • API_KEYS: (Required) A comma-separated list of secret keys for API authentication. For example: key1,key2,anotherkey
  • DB_PATH_EN: Path to the English SQLite database. Defaults to ./data/events.db.
  • DB_PATH_RU: Path to the Russian SQLite database. Defaults to ./data/events_ru.db.
  • PORT: Port for the API server. Defaults to 3000.

Testing

API will be publicly available in Q3 2025, if you want to test API now, DM @Tony on Nostr – I'll be happy to share a key with you.

⚡️zapmeacoffee

About

The single source of truth for the Bitcoin Calendar project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published