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.1.tar.gz
(7.7 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.1.tar.gz.
File metadata
- Download URL: globeapi-1.0.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e37cd8a161f87b8d9e3d3e6eba69d5f18ca01186fedb0b9c34112c2cc55f0974
|
|
| MD5 |
a79c6eb7609e1a395c4dc1021a6c6dbe
|
|
| BLAKE2b-256 |
d7807b1b86254b6147b4c0b98398bf68cdbcf12712c3d2f4c9002d02760c1cf2
|
File details
Details for the file globeapi-1.0.1-py3-none-any.whl.
File metadata
- Download URL: globeapi-1.0.1-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 |
9c4374f59663de9eb8287a9ff398dcbbd5a4a32bec73d41bf8f32a09f3b2e6d4
|
|
| MD5 |
610f9496771f51a45a83df9139307321
|
|
| BLAKE2b-256 |
2eb43d530b8c3ea248b0f38f224135f883679eb52cf297979f3be90c3eae1d8a
|