Skip to content

API Reference

Hummingbird uses a simple, easy to integrate RESTful API for all endpoints.

Base URL

http
https://api.hummingbirdapi.com

Authentication

Include your API key in the X-API-Key header:

bash
curl -H "X-API-Key: hb_live_xxxxx" \
  "https://api.hummingbirdapi.com/v1/geo/lookup"

See Authentication for details.

Response Format

All responses use a unified envelope format with these fields in order:

Success

json
{
  "success": true,
  "data": { ... },
  "error": false,
  "error_code": null,
  "error_message": null
}

Error

json
{
  "success": false,
  "data": null,
  "error": true,
  "error_code": 20001,
  "error_message": "Missing API key"
}

Endpoints

EndpointDescription
GET /v1/geo/lookupIP geolocation

Versioning

Versions are specified in the URL path for the given API:

http
/v1/geo/lookup
     ^^

APIs are backwards compatible within major versions.

Examples

bash
curl -H "X-API-Key: $HUMMINGBIRD_API_KEY" \
  "https://api.hummingbirdapi.com/v1/geo/lookup"
javascript
const response = await fetch(
  'https://api.hummingbirdapi.com/v1/geo/lookup',
  { headers: { 'X-API-Key': process.env.HUMMINGBIRD_API_KEY } }
);
const data = await response.json();
python
import requests
import os

response = requests.get(
    'https://api.hummingbirdapi.com/v1/geo/lookup',
    headers={'X-API-Key': os.environ['HUMMINGBIRD_API_KEY']}
)
data = response.json()
go
req, _ := http.NewRequest("GET",
    "https://api.hummingbirdapi.com/v1/geo/lookup", nil)
req.Header.Set("X-API-Key", os.Getenv("HUMMINGBIRD_API_KEY"))

resp, _ := client.Do(req)
defer resp.Body.Close()

var result GeoResponse
json.NewDecoder(resp.Body).Decode(&result)
ruby
require 'httparty'

response = HTTParty.get(
  'https://api.hummingbirdapi.com/v1/geo/lookup',
  headers: { 'X-API-Key' => ENV['HUMMINGBIRD_API_KEY'] }
)
data = response.parsed_response
php
$response = Http::withHeaders([
    'X-API-Key' => getenv('HUMMINGBIRD_API_KEY')
])->get('https://api.hummingbirdapi.com/v1/geo/lookup');

$data = $response->json();

Built with VitePress