Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

letsbooking — Python API client

Agent-native stay search for Airbnb and Booking.com with total-price ranking.

pip install letsbooking
# or: pip install -e .

Quick start

from letsbooking import LetsBooking

client = LetsBooking(api_key="lb_live_…")  # or ADMIN key

# Natural language
result = client.search("Barcelona apartment 2 guests Aug 10-14 2026")
print(result.cheapest.summary())
print(result.cheapest.url)

# Structured
result = client.search_stays(
    location="Lisbon",
    check_in="2026-09-01",
    check_out="2026-09-05",
    guests=2,
    sources=["airbnb", "booking"],
    currency="EUR",
)
for offer in result.offers[:5]:
    print(offer.source, offer.price.total, offer.title)

Async

import asyncio
from letsbooking import AsyncLetsBooking

async def main():
    async with AsyncLetsBooking(api_key="lb_live_…") as client:
        result = await client.search("Paris loft 2 guests Sep 12-16 2026")
        print(result.total_results, result.cheapest)

asyncio.run(main())

CLI

export LETSBOOKING_API_KEY=lb_live_…
letsbooking search "Barcelona 2 guests Aug 10-14 2026"
letsbooking search --location Lisbon --check-in 2026-09-01 --check-out 2026-09-05 --guests 2
letsbooking health
letsbooking sources

API key

  1. Open https://letsbooking.bitscorp.co and request a key, or
  2. Admin mints one at /admin
export LETSBOOKING_API_KEY=lb_live_…
# or pass api_key= to the constructor

Default base URL: https://letsbooking.bitscorp.co

LetsBooking(api_key="…", base_url="http://localhost:8787")

What it does

  1. POST /api/search (NL or structured)
  2. Polls GET /api/results/{id} until completed
  3. Returns typed SearchResult with StayOffer list sorted by total price

Also supports:

  • request_access(name, email, …) — public key request
  • public_search(…) — no auth, sandbox demo
  • sources() — connector readiness
  • Admin helpers when using an admin key

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages