Metadata-Version: 2.4
Name: autobodyshop-api
Version: 0.1.1
Summary: Zero-dependency client for the Auto Body Shop Directory public API - find US auto body shops by ZIP code, city, location, or shop profile (autobodyshopnear.com).
Project-URL: Homepage, https://autobodyshopnear.com/developers/body-shop-api
Project-URL: Documentation, https://autobodyshopnear.com/developers/body-shop-api
Project-URL: Website, https://autobodyshopnear.com
Project-URL: Source, https://github.com/Sorbh/autobodyshop-api
Project-URL: Issues, https://github.com/Sorbh/autobodyshop-api/issues
Project-URL: Terms of Service, https://autobodyshopnear.com/terms-of-service
Author-email: Auto BodyShop Near <hello@autobodyshopnear.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api-client,auto-body-shop,car-repair,collision-repair,directory,geolocation,local-business,zip-code
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# autobodyshop-api

Zero-dependency Python client for the [Auto Body Shop Directory public API](https://autobodyshopnear.com/developers/body-shop-api) — find US auto body shops, collision centers, and paint shops by ZIP code, city, location, or shop profile.

Powered by [AutoBodyShopNear.com](https://autobodyshopnear.com), a directory of 80,000+ US auto body shops.

- **No API key required** — the public API is free to use
- **Zero dependencies** — standard library only (Python 3.8+)

## Install

```bash
pip install autobodyshop-api
```

## Usage

```python
from autobodyshop_api import AutoBodyShopClient

client = AutoBodyShopClient()

# Find shops in a ZIP code
by_zip = client.shops_by_zip("77056")
print(by_zip["items"])

# Find shops in a city
by_city = client.shops_by_city("Houston", state="TX", limit=10)

# Find shops near a location
nearby = client.shops_nearby(29.7604, -95.3698, radius_miles=25)

# Fetch one shop's profile by slug
shop = client.shop_by_slug("champion-auto-parts-houston-tx-77056")
print(shop["name"], shop["profileUrl"])
```

### Pagination

List endpoints accept `limit` (1–100, default 20) and `offset`, and return `items`, `limit`, `offset`, `total`, and `hasMore`:

```python
offset, all_shops = 0, []
while True:
    page = client.shops_by_city("Houston", state="TX", limit=100, offset=offset)
    all_shops.extend(page["items"])
    if not page["hasMore"]:
        break
    offset += page["limit"]
```

### Error handling

Failed requests raise `AutoBodyShopApiError` with `status` (HTTP status) and `code` (e.g. `VALIDATION_ERROR`, `NOT_FOUND`):

```python
from autobodyshop_api import AutoBodyShopApiError

try:
    client.shop_by_slug("does-not-exist")
except AutoBodyShopApiError as err:
    print(err.code, err.status, err)
```

## API reference

| Method | Endpoint | Description |
|---|---|---|
| `index()` | `GET /` | API metadata and endpoint index |
| `shops_by_zip(zip_code, ...)` | `GET /shops/by-zip` | Shops in a 5-digit ZIP code |
| `shops_by_city(city, state=None, ...)` | `GET /shops/by-city` | Shops in a city (optional state) |
| `shops_nearby(lat, lng, radius_miles=None, ...)` | `GET /shops/nearby` | Shops near a lat/lng (radius 1–200 miles) |
| `shop_by_slug(slug)` | `GET /shops/{slug}` | Single shop profile |

Full API documentation: **[autobodyshopnear.com/developers/body-shop-api](https://autobodyshopnear.com/developers/body-shop-api)**
OpenAPI spec: [openapi.json](https://autobodyshopnear.com/developers/body-shop-api/openapi.json)

## Links

- Website: [autobodyshopnear.com](https://autobodyshopnear.com)
- Terms of service: [autobodyshopnear.com/terms-of-service](https://autobodyshopnear.com/terms-of-service)
- Node.js client: [`autobodyshop-api` on npm](https://www.npmjs.com/package/autobodyshop-api)

## License

MIT
