# Trekbikes — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Browse Trek's complete bike catalog by category, view detailed specifications and customer reviews, and search for specific models to find exactly what you're looking for. Locate nearby Trek shops and compare bikes to make an informed purchase decision.

**Category:** E-commerce | **Website:** [trekbikes.com/](https://trekbikes.com/) | **Docs:** [parse.bot/marketplace/e84db27d-841a-45ee-b564-4033c5f4a891/trekbikes-com-api](https://parse.bot/marketplace/e84db27d-841a-45ee-b564-4033c5f4a891/trekbikes-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### find_bike_shops

Find Trek-authorized bike shops near a given location. Returns up to 15 stores per page sorted by proximity with address, opening hours, and distance information. Coordinates are WGS84 decimal degrees.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `latitude` | string | Yes | Latitude coordinate in decimal degrees (e.g. 40.7128) |
| `longitude` | string | Yes | Longitude coordinate in decimal degrees (e.g. -74.0060) |
| `radius` | integer | No | Search radius in miles |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/find_bike_shops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"latitude":"<string>","longitude":"<string>","radius":"<integer>"}'
```

### get_bike_categories

Retrieve the complete category tree for bikes including Electric, Mountain, Road, Gravel, City, and Kids sections. Each category includes subcategories with optional category codes for use in list_bikes_by_category. Returns all sections in a single call with no parameters.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/get_bike_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_bike_details

Get detailed information for a specific bike model variant, including technical specifications grouped by category and stock status. Returns a single product object. Product IDs can be obtained from list_bikes_by_category or search_bikes results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product ID from list_bikes_by_category or search_bikes results (e.g. 46766, 48615) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/get_bike_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### get_bike_reviews

Retrieve customer reviews for a specific bike model from PowerReviews. Returns review data including ratings, review text, and rollup statistics. Products without reviews return an empty reviews array. Product IDs from list_bikes_by_category or search_bikes.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product ID from list_bikes_by_category or search_bikes results (e.g. 46766, 48615) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/get_bike_reviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### list_bikes_by_category

List bikes in a specific category with pagination and sorting. Uses the allCategories filter. Category codes can be obtained from get_bike_categories subcategories or from product URLs (e.g. B213-2 from /c/B213-2/). Returns products array and flat pagination metadata including total pages and total results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_code` | string | Yes | Category code from get_bike_categories or product page URLs (e.g. B338 for Powerfly+ FS, B512 for Electric Mountain Bikes) |
| `page` | integer | No | Page number (0-based) |
| `page_size` | integer | No | Results per page |
| `sort` | string | No | Sort order for results |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/list_bikes_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_code":"<string>","page":"<integer>","page_size":"<integer>","sort":"<string>"}'
```

### search_bikes

Search for bikes and products by keyword using autocomplete. Returns matching products with prices and images, plus search term suggestions. Results are limited to the top matches from the autocomplete endpoint.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g. Madone, Domane, mountain, road) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-trekbikes-com-api-e84db27d/search_bikes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
