# G2A — 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 for game keys and get real-time pricing, seller ratings, and detailed product information from G2A's marketplace. Browse available categories and find the best deals on digital game licenses from verified sellers.

**Category:** Marketplaces | **Website:** [g2a.com/](https://g2a.com/) | **Docs:** [parse.bot/marketplace/ac7a5b18-b0f8-4d22-b58a-c479ff4e14a8/g2a-com-api](https://parse.bot/marketplace/ac7a5b18-b0f8-4d22-b58a-c479ff4e14a8/g2a-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-g2a-com-api-ac7a5b18/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_categories

Retrieve the full category tree from G2A's navigation menu. Returns top-level categories (Gaming, Software, Subscriptions, Gift cards, etc.) and their subcategories with slugs suitable for browsing.

**Estimated cost:** Metered

_No parameters required._

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

### get_product_details

Retrieve full details for a specific product by its URL slug, including description, rating, and all available seller offers with pricing and reputation data. The slug is obtained from search_products results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | Product slug from search_products results (e.g. 'elden-ring-pc-steam-key-united-states-i10000273674037') |

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

### search_products

Full-text search over G2A's product catalog. Returns a paginated list of products matching the query, each with pricing, platform, region, and stock info. Up to 18 items per page. Paginates via integer page counter. Returns has_next to indicate more pages available.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination (1-based) |
| `query` | string | Yes | Search keyword (e.g. 'elden ring', 'windows 11') |

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