Hack Club Geocoder

Turn addresses into coordinates and IPs into locations with standardized response formats.

A geocoding and IP geolocation API service with intelligent caching and consistent response formats. Built for Hack Club projects that need reliable location data.

Quick start with an API key from a Hack Club HQ staff member:

curl "https://geocoder.hackclub.com/v1/geocode?address=1600+Amphitheatre+Parkway&key=your_api_key"

# Returns:
{
  "lat": 37.4223,
  "lng": -122.0844,
  "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
  "state_name": "California",
  "state_code": "CA",
  "country_name": "United States",
  "country_code": "US",
  "backend": "google_maps_platform_geocoding",
  "raw_backend_response": { ... }
}

API Endpoints

GET /v1/geocode

Convert addresses to coordinates.

GET /v1/geocode?address=1600+Amphitheatre+Parkway&key=your_api_key

Response format:

{
  "lat": 37.4223,
  "lng": -122.0844,
  "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
  "state_name": "California",
  "state_code": "CA",
  "country_name": "United States",
  "country_code": "US",
  "backend": "google_maps_platform_geocoding",
  "raw_backend_response": { ... }
}

Note: The raw_backend_response contains the complete response from Google Maps Platform Geocoding API. For detailed field documentation, see Google's official documentation.

GET /v1/geocode_structured

Convert structured addresses to coordinates using separate address components.

GET /v1/geocode_structured?address_line_1=1600+Amphitheatre+Parkway&city=Mountain+View&state=CA&postal_code=94043&country=USA&key=your_api_key

Note: All address fields are optional, but at least one must be provided.

Response format: Same as /v1/geocode endpoint

Benefits: Better geocoding accuracy with structured input, easier integration for form-based address collection.

GET /v1/geoip

Get location from IP addresses.

GET /v1/geoip?ip=8.8.8.8&key=your_api_key

Response format:

{
  "lat": 37.4056,
  "lng": -122.0775,
  "ip": "8.8.8.8",
  "city": "Mountain View",
  "region": "California",
  "country_name": "United States",
  "country_code": "US",
  "postal_code": "94043",
  "timezone": "America/Los_Angeles",
  "org": "AS15169 Google LLC",
  "backend": "ipinfo_api",
  "raw_backend_response": { ... }
}

Note: The raw_backend_response contains the complete response from IPinfo API. For detailed field documentation, see IPinfo's developer documentation.

GET /v1/reverse_geocode

Convert coordinates (latitude and longitude) to an address using Google's reverse geocoding service.

Parameters

Example Request

GET /v1/reverse_geocode?lat=37.422476&lng=-122.084250&key=your_api_key

Example Response

{
  "lat": 37.422476,
  "lng": -122.084250,
  "formatted_address": "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA",
  "address_line_1": "1600 Amphitheatre Parkway",
  "city": "Mountain View",
  "state": "CA",
  "state_full": "California",
  "postal_code": "94043",
  "country_name": "United States",
  "country_code": "US",
  "backend": "google_maps_platform_geocoding",
  "raw_backend_response": { ... }
}

Note: The raw_backend_response contains the complete response from Google's Geocoding API. For detailed field documentation, see Google's geocoding documentation.

GET /health

Check service status. No authentication required.

Features

Error Handling

Errors return JSON with standard HTTP status codes:

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Common error codes: