geofox_ex

An Elixir client library for the Hamburg Public Transport (HVV) Geofox API.

The Geofox API provides public transport information for the Hamburg metropolitan area, including route planning, real-time departures, station information, and tariff calculations.

Installation

Add geofox_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:geofox_ex, "~> 0.1.0"}
  ]
end

Configuration

Most endpoints work without authentication, but some require API credentials from HBT GmbH:

config :geofox,
  user: "your_user_id",
  password: "your_secret_key"

Usage

Basic Usage

# Create a client
client = Geofox.new()

# Initialize session
{:ok, info} = Geofox.init(client)

# Search for stations
station = Geofox.station("Hauptbahnhof")
{:ok, results} = Geofox.check_name(client, station)

Route Planning

# Plan a route
start = Geofox.station("Hauptbahnhof", "Master:1")
dest = Geofox.station("Flughafen", "Master:3690")
time = Geofox.gti_time("2024-01-15", "14:30")

{:ok, routes} = Geofox.get_route(client, start, dest, time)

Departure Information

# Get departures for a station
station = Geofox.station("Hauptbahnhof", "Master:1")
time = Geofox.gti_time("2024-01-15", "14:30")

{:ok, departures} = Geofox.departure_list(client, station, time)

Real-time Vehicle Information

# Get vehicle positions in a bounding box
lower_left = Geofox.coordinate(9.9, 53.5)
upper_right = Geofox.coordinate(10.1, 53.6)
bbox = Geofox.bounding_box(lower_left, upper_right)

{:ok, vehicles} = Geofox.get_vehicle_map(client, bbox)

Features

Documentation

Full API documentation is available at HexDocs.

License

This project is licensed under the MIT License - see the LICENSE file for details.