# OpenTable REST API Client
A Python client library for the OpenTable REST API. Search restaurants, check availability, book reservations, and manage your dining experiences programmatically.
## Features
- 🔍 **Restaurant Search**: Find restaurants by location and cuisine
- 📅 **Availability Check**: Get real-time availability for any restaurant
- 📝 **Reservation Management**: Book, modify, and cancel reservations
- 💳 **Payment Methods**: Add and manage credit cards
- 👤 **User Management**: Register and authenticate users
- 🔄 **Async Support**: Full async/await support for all operations
## Installation
```bash
pip install opentable-rest-client
```
## Quick Start
### Basic Usage
```python
from opentable_client.client import Client
from opentable_client.models import UserCreate, SearchRequest
from opentable_client.api.production import register_user_production_auth_register_post
from opentable_client.api.default import search_restaurants_search_post
# Initialize client
client = Client(base_url="https://apparel-scraper--opentable-rest-api-fastapi-app.modal.run")
# Register a test user
user_data = UserCreate(
first_name="John",
last_name="Doe",
phone_number="5551234567"
)
user_response = register_user_production_auth_register_post.sync_detailed(
client=client,
body=user_data,
x_org_key="your-org-key"
)
user = user_response.parsed
print(f"Registered: {user.email}")
# Create authenticated client
auth_client = Client(
base_url="https://apparel-scraper--opentable-rest-api-fastapi-app.modal.run",
headers={
"Authorization": f"Bearer {user.api_token}",
"X-Org-Key": "your-org-key"
}
)
# Search for restaurants
search_request = SearchRequest(
location="New York, NY",
restaurant_name="italian",
party_size=2
)
restaurants = search_restaurants_search_post.sync(
client=auth_client,
body=search_request,
x_org_key="your-org-key"
)
print(f"Found {len(restaurants)} restaurants")
```
### Async Usage
```python
import asyncio
from opentable_client.api.default import search_restaurants_search_post
async def search_async():
restaurants = await search_restaurants_search_post.asyncio(
client=auth_client,
body=search_request,
x_org_key="your-org-key"
)
return restaurants
restaurants = asyncio.run(search_async())
```
## API Coverage
This client provides access to all OpenTable REST API endpoints:
### Authentication & Users
- ✅ User registration
- ✅ Token-based authentication
### Restaurant Operations
- ✅ Restaurant search with filters
- ✅ Get restaurant availability
- ✅ Get detailed restaurant information
### Reservation Management
- ✅ Book reservations
- ✅ List user reservations
- ✅ Modify existing reservations
- ✅ Cancel reservations
### Payment Methods
- ✅ Add credit cards
- ✅ List saved payment methods
- ✅ Handle card-required reservations
## Configuration
The client requires:
1. **Base URL**: The OpenTable API endpoint
2. **Org Key**: Your organization key for API access
3. **API Token**: User token (obtained via registration)
```python
# Basic client (for registration only)
client = Client(base_url="https://your-api-endpoint.com")
# Authenticated client (for all operations)
auth_client = Client(
base_url="https://your-api-endpoint.com",
headers={
"Authorization": f"Bearer {api_token}",
"X-Org-Key": "your-org-key"
}
)
```
## Complete Workflow Example
See [example_usage.py](example_usage.py) for a complete workflow that demonstrates:
1. User registration
2. Restaurant search
3. Availability checking
4. Credit card management
5. Reservation booking
6. Reservation management
## Error Handling
The client provides detailed error responses:
```python
response = search_restaurants_search_post.sync_detailed(
client=auth_client,
body=search_request,
x_org_key="your-org-key"
)
if response.status_code == 200:
restaurants = response.parsed
print(f"Success: {len(restaurants)} restaurants found")
else:
print(f"Error {response.status_code}: {response.content}")
```
## Contributing
This client is auto-generated from the OpenTable API OpenAPI specification. To update:
1. Get the latest OpenAPI schema
2. Regenerate using `openapi-python-client`
3. Test with the example usage script
## License
MIT License - see LICENSE file for details.
## Support
For API-related issues, refer to the OpenTable API documentation.
For client library issues, please open a GitHub issue.
Raw data
{
"_id": null,
"home_page": null,
"name": "opentable-rest-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "opentable, restaurant, reservations, api, booking",
"author": "wheelis",
"author_email": "noreply@github.com",
"download_url": "https://files.pythonhosted.org/packages/38/6f/f7ae78f5da2fc9a4b2383cb6a22160189b4370be1aba105e93837ade1626/opentable_rest_client-1.0.1.tar.gz",
"platform": null,
"description": "# OpenTable REST API Client\n\nA Python client library for the OpenTable REST API. Search restaurants, check availability, book reservations, and manage your dining experiences programmatically.\n\n## Features\n\n- \ud83d\udd0d **Restaurant Search**: Find restaurants by location and cuisine\n- \ud83d\udcc5 **Availability Check**: Get real-time availability for any restaurant\n- \ud83d\udcdd **Reservation Management**: Book, modify, and cancel reservations\n- \ud83d\udcb3 **Payment Methods**: Add and manage credit cards\n- \ud83d\udc64 **User Management**: Register and authenticate users\n- \ud83d\udd04 **Async Support**: Full async/await support for all operations\n\n## Installation\n\n```bash\npip install opentable-rest-client\n```\n\n## Quick Start\n\n### Basic Usage\n\n```python\nfrom opentable_client.client import Client\nfrom opentable_client.models import UserCreate, SearchRequest\nfrom opentable_client.api.production import register_user_production_auth_register_post\nfrom opentable_client.api.default import search_restaurants_search_post\n\n# Initialize client\nclient = Client(base_url=\"https://apparel-scraper--opentable-rest-api-fastapi-app.modal.run\")\n\n# Register a test user\nuser_data = UserCreate(\n first_name=\"John\",\n last_name=\"Doe\", \n phone_number=\"5551234567\"\n)\n\nuser_response = register_user_production_auth_register_post.sync_detailed(\n client=client,\n body=user_data,\n x_org_key=\"your-org-key\"\n)\n\nuser = user_response.parsed\nprint(f\"Registered: {user.email}\")\n\n# Create authenticated client\nauth_client = Client(\n base_url=\"https://apparel-scraper--opentable-rest-api-fastapi-app.modal.run\",\n headers={\n \"Authorization\": f\"Bearer {user.api_token}\",\n \"X-Org-Key\": \"your-org-key\"\n }\n)\n\n# Search for restaurants\nsearch_request = SearchRequest(\n location=\"New York, NY\",\n restaurant_name=\"italian\",\n party_size=2\n)\n\nrestaurants = search_restaurants_search_post.sync(\n client=auth_client,\n body=search_request,\n x_org_key=\"your-org-key\"\n)\n\nprint(f\"Found {len(restaurants)} restaurants\")\n```\n\n### Async Usage\n\n```python\nimport asyncio\nfrom opentable_client.api.default import search_restaurants_search_post\n\nasync def search_async():\n restaurants = await search_restaurants_search_post.asyncio(\n client=auth_client,\n body=search_request,\n x_org_key=\"your-org-key\"\n )\n return restaurants\n\nrestaurants = asyncio.run(search_async())\n```\n\n## API Coverage\n\nThis client provides access to all OpenTable REST API endpoints:\n\n### Authentication & Users\n- \u2705 User registration\n- \u2705 Token-based authentication\n\n### Restaurant Operations \n- \u2705 Restaurant search with filters\n- \u2705 Get restaurant availability\n- \u2705 Get detailed restaurant information\n\n### Reservation Management\n- \u2705 Book reservations\n- \u2705 List user reservations\n- \u2705 Modify existing reservations\n- \u2705 Cancel reservations\n\n### Payment Methods\n- \u2705 Add credit cards\n- \u2705 List saved payment methods\n- \u2705 Handle card-required reservations\n\n## Configuration\n\nThe client requires:\n\n1. **Base URL**: The OpenTable API endpoint\n2. **Org Key**: Your organization key for API access \n3. **API Token**: User token (obtained via registration)\n\n```python\n# Basic client (for registration only)\nclient = Client(base_url=\"https://your-api-endpoint.com\")\n\n# Authenticated client (for all operations)\nauth_client = Client(\n base_url=\"https://your-api-endpoint.com\",\n headers={\n \"Authorization\": f\"Bearer {api_token}\",\n \"X-Org-Key\": \"your-org-key\"\n }\n)\n```\n\n## Complete Workflow Example\n\nSee [example_usage.py](example_usage.py) for a complete workflow that demonstrates:\n\n1. User registration\n2. Restaurant search \n3. Availability checking\n4. Credit card management\n5. Reservation booking\n6. Reservation management\n\n## Error Handling\n\nThe client provides detailed error responses:\n\n```python\nresponse = search_restaurants_search_post.sync_detailed(\n client=auth_client,\n body=search_request,\n x_org_key=\"your-org-key\"\n)\n\nif response.status_code == 200:\n restaurants = response.parsed\n print(f\"Success: {len(restaurants)} restaurants found\")\nelse:\n print(f\"Error {response.status_code}: {response.content}\")\n```\n\n## Contributing\n\nThis client is auto-generated from the OpenTable API OpenAPI specification. To update:\n\n1. Get the latest OpenAPI schema\n2. Regenerate using `openapi-python-client`\n3. Test with the example usage script\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Support\n\nFor API-related issues, refer to the OpenTable API documentation.\nFor client library issues, please open a GitHub issue.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python client library for the OpenTable REST API - search, book, and manage restaurant reservations",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://github.com/wheelis/opentable_mcp/blob/main/python_client/README.md",
"Homepage": "https://github.com/wheelis/opentable_mcp",
"Repository": "https://github.com/wheelis/opentable_mcp"
},
"split_keywords": [
"opentable",
" restaurant",
" reservations",
" api",
" booking"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "03f11cc5c9777ab561f42291f732796d069ee39d6a057dc01e3e3cd6ae1529dc",
"md5": "a3836885d26baba2029febb70e8748ef",
"sha256": "b6e813c3f9e85ead72e451c370d2298f7867d84a4c552e4dce4b546d3cd4b775"
},
"downloads": -1,
"filename": "opentable_rest_client-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a3836885d26baba2029febb70e8748ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 33702,
"upload_time": "2025-07-26T21:40:28",
"upload_time_iso_8601": "2025-07-26T21:40:28.592229Z",
"url": "https://files.pythonhosted.org/packages/03/f1/1cc5c9777ab561f42291f732796d069ee39d6a057dc01e3e3cd6ae1529dc/opentable_rest_client-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "386ff7ae78f5da2fc9a4b2383cb6a22160189b4370be1aba105e93837ade1626",
"md5": "401b0770d2b895aa3cd945921fe1b19c",
"sha256": "f1d69bb82134a04436dbfdb94e3a6f3c070ef5eb9ccaf6b48c6dd0463232aa77"
},
"downloads": -1,
"filename": "opentable_rest_client-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "401b0770d2b895aa3cd945921fe1b19c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 15485,
"upload_time": "2025-07-26T21:40:30",
"upload_time_iso_8601": "2025-07-26T21:40:30.088200Z",
"url": "https://files.pythonhosted.org/packages/38/6f/f7ae78f5da2fc9a4b2383cb6a22160189b4370be1aba105e93837ade1626/opentable_rest_client-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 21:40:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wheelis",
"github_project": "opentable_mcp",
"github_not_found": true,
"lcname": "opentable-rest-client"
}