autobodyshop-api
v0.1.1
Published
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).
Maintainers
Readme
autobodyshop-api
Zero-dependency Node.js client for the Auto Body Shop Directory public API — find US auto body shops, collision centers, and paint shops by ZIP code, city, location, or shop profile.
Powered by AutoBodyShopNear.com, a directory of 80,000+ US auto body shops.
- No API key required — the public API is free to use
- Zero dependencies — uses the built-in
fetch(Node 18+) - TypeScript types included
Install
npm install autobodyshop-apiUsage
import { AutoBodyShopClient } from 'autobodyshop-api';
// or: const { AutoBodyShopClient } = require('autobodyshop-api');
const client = new AutoBodyShopClient();
// Find shops in a ZIP code
const byZip = await client.shopsByZip('77056');
console.log(byZip.items);
// Find shops in a city
const byCity = await client.shopsByCity('Houston', { state: 'TX', limit: 10 });
// Find shops near a location
const nearby = await client.shopsNearby(29.7604, -95.3698, { radiusMiles: 25 });
// Fetch one shop's profile by slug
const shop = await client.shopBySlug('champion-auto-parts-houston-tx-77056');
console.log(shop.name, shop.profileUrl);Pagination
List endpoints accept limit (1–100, default 20) and offset, and return { items, limit, offset, total, hasMore }:
let offset = 0, all = [];
while (true) {
const page = await client.shopsByCity('Houston', { state: 'TX', limit: 100, offset });
all.push(...page.items);
if (!page.hasMore) break;
offset += page.limit;
}Error handling
Failed requests throw AutoBodyShopApiError with status (HTTP status) and code (e.g. VALIDATION_ERROR, NOT_FOUND):
import { AutoBodyShopApiError } from 'autobodyshop-api';
try {
await client.shopBySlug('does-not-exist');
} catch (err) {
if (err instanceof AutoBodyShopApiError) console.error(err.code, err.message);
}API reference
| Method | Endpoint | Description |
|---|---|---|
| index() | GET / | API metadata and endpoint index |
| shopsByZip(zip, opts?) | GET /shops/by-zip | Shops in a 5-digit ZIP code |
| shopsByCity(city, opts?) | GET /shops/by-city | Shops in a city (optional state) |
| shopsNearby(lat, lng, opts?) | GET /shops/nearby | Shops near a lat/lng (radiusMiles 1–200) |
| shopBySlug(slug) | GET /shops/{slug} | Single shop profile |
Full API documentation: autobodyshopnear.com/developers/body-shop-api OpenAPI spec: openapi.json
Links
- Website: autobodyshopnear.com
- Terms of service: autobodyshopnear.com/terms-of-service
- Python client:
autobodyshop-apion PyPI
License
MIT
