Official Python SDK for GlobeAPI — the unified travel API platform
Project description
GlobeAPI Python SDK
Official Python SDK for GlobeAPI -- the unified travel API platform.
Installation
pip install globeapi
Quick Start
from globeapi import Client
client = Client("your-api-key")
# Search for places
places = client.places.search("Eiffel Tower")
# Reverse geocode
location = client.places.geocode(lat=48.8584, lng=2.2945)
# Search cities
cities = client.cities.search("Paris")
# Search flights
flights = client.flights.search(
origin="JFK",
destination="CDG",
date="2026-06-15",
passengers=2,
cabin_class="business",
)
# Search hotels
hotels = client.hotels.search(
city="Paris",
check_in="2026-06-15",
check_out="2026-06-20",
guests=2,
rooms=1,
)
# AI travel assistant
answer = client.ai.chat("What are the best restaurants in Rome?")
# Streaming AI chat
for chunk in client.ai.chat("Plan a 3-day trip to Tokyo", stream=True):
print(chunk, end="")
# AI vision
import base64
with open("photo.jpg", "rb") as f:
image_b64 = base64.b64encode(f.read()).decode()
description = client.ai.vision(image_b64, message="Where was this photo taken?")
# Voice transcription
with open("audio.wav", "rb") as f:
audio_b64 = base64.b64encode(f.read()).decode()
transcript = client.voice.transcribe(audio_b64)
# Image moderation
result = client.moderation.check(image_b64)
# Community photos
photos = client.photos.search(query="sunset", country="IT", limit=5)
# AI trip planner
trip = client.trips.plan("Barcelona", days=5, interests=["food", "architecture"])
Configuration
# Custom base URL
client = Client("your-api-key", base_url="https://custom.endpoint.com")
# Custom timeout (seconds)
client = Client("your-api-key", timeout=60)
Context Manager
The client can be used as a context manager to automatically close the underlying HTTP session:
with Client("your-api-key") as client:
places = client.places.search("Big Ben")
Error Handling
from globeapi import Client, GlobeAPIError
client = Client("your-api-key")
try:
flights = client.flights.search("JFK", "CDG", "2026-06-15")
except GlobeAPIError as e:
print(f"Status: {e.status_code}")
print(f"Message: {e.message}")
print(f"Body: {e.body}")
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
globeapi-1.0.0.tar.gz
(7.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file globeapi-1.0.0.tar.gz.
File metadata
- Download URL: globeapi-1.0.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f718a575e639569890eb9219386fab1e29283c6c36157f18db93f47a30bf6c0
|
|
| MD5 |
32326a22ec8e02bafbe13b3806886e01
|
|
| BLAKE2b-256 |
ed62dbcf9407a9118ffc899cf766e8b6b52190bfebcf6ee852e3f25534e2e34b
|
File details
Details for the file globeapi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: globeapi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fa13048c40c3a1510bc147746478c222c952a16bdd979cc303b75d52acba34f
|
|
| MD5 |
fd8d7d3595606d6a5bd9aac4e47d1334
|
|
| BLAKE2b-256 |
36020cf06c7384b4ee2f41c7821ecb2a340a17e3c00669393d4ad103a83b81d7
|