# Sparkfun — 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.

> Search SparkFun's electronics catalog, view product details, pricing, and stock availability, and discover today's featured deals. Browse product categories to find components, tools, and kits while staying updated on current promotions.

**Category:** E-commerce | **Website:** [sparkfun.com/](https://sparkfun.com/) | **Docs:** [parse.bot/marketplace/ed724a95-39f8-4025-9e3d-79a8ed6d6b27/sparkfun-com-api](https://parse.bot/marketplace/ed724a95-39f8-4025-9e3d-79a8ed6d6b27/sparkfun-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-sparkfun-com-api-ed724a95/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### browse_category

Browse products in a specific category. Returns paginated product listings. Use list_all_categories to discover available category slugs. Supports sorting and page size control.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_slug` | string | Yes | Category URL slug (e.g. 'audio', 'components', 'audio/audio-boards'). Obtain from list_all_categories results. |
| `limit` | string | No | Items per page. Accepted values: 12, 24, 36, 48, all. |
| `page` | integer | No | Page number for pagination. |
| `sort_by` | string | No | Sort field. Accepted values: name, price, sf_golive_date, relevance. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sparkfun-com-api-ed724a95/browse_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_slug":"<string>","limit":"<string>","page":"<integer>","sort_by":"<string>"}'
```

### get_product_details

Retrieve full details for a single product given its URL slug. Returns name, SKU, price, stock status, description, features/specs, documentation links, images, rating, and review count. Slugs are obtained from search_products or browse_category results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product URL slug (e.g. 'arduino-uno-r4-minima', 'sparkfun-qwiic-buzzer'). Obtain slugs from search_products or browse_category results. |

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

### get_product_pricing_and_stock

Get current price, bulk pricing tiers, and stock status for a product. Fetches the product page and optionally queries the stock API for live availability. Use when only pricing/stock info is needed without full description.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product URL slug (e.g. 'arduino-uno-r4-minima'). Obtain slugs from search_products or browse_category results. |

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

### get_todays_deals

Retrieve current discounted products from SparkFun's Today's Deals page. Returns an array of deal items with name, price, URL, slug, and thumbnail image.

**Estimated cost:** Metered

_No parameters required._

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

### list_all_categories

Retrieve the full category hierarchy from SparkFun. Returns top-level categories with their subcategories, URLs, and slugs. Use the returned slugs as input to browse_category.

**Estimated cost:** Metered

_No parameters required._

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

### search_products

Full-text search over SparkFun's product catalog. Returns paginated results sorted by relevance, name, price, or go-live date. Each result includes product name, price, URL slug, and thumbnail. Use the slug to fetch full details via get_product_details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | string | No | Items per page. Accepted values: 12, 24, 36, 48, all. |
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword (e.g. 'arduino', 'sensor', 'led'). |
| `sort_by` | string | No | Sort field. Accepted values: name, price, sf_golive_date, relevance. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sparkfun-com-api-ed724a95/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<string>","page":"<integer>","query":"<string>","sort_by":"<string>"}'
```
