Skip to main content

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


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.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

globeapi-1.0.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file globeapi-1.0.2.tar.gz.

File metadata

  • Download URL: globeapi-1.0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for globeapi-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c3886861fc134eab200729ee611cb521aa03e8cf1fab772c24faaa06617ed587
MD5 ad559a8b041ffa838edd1930c56dbf70
BLAKE2b-256 28d14dfb1bdf7894dd842d3dcaaef9c6b4b491ae9aae571c7510026d5b31c505

See more details on using hashes here.

File details

Details for the file globeapi-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: globeapi-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for globeapi-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fbacbedd2d436e54f5b9047f09e061b666531c6cfeccc8f33a2edae56f1fd21b
MD5 2705de093831e225f490c8a8819729f1
BLAKE2b-256 8ea3339754cf8beab959e41320f2b1f1439a51a076c9da5f707da14a3227b17d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page