> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pixcraft.es/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Convert any image into a physical pattern using the PixCraft API.

# PixCraft API

The PixCraft API lets you integrate image-to-pattern conversion into any application. Whether you're building an e-commerce platform, a crafting app, or an automation workflow, the API gives you access to the same engine that powers pixcraft.es.

## What you can build

* **Material stores** — Add a pattern configurator to your product pages so customers can visualize their projects before buying.
* **Crafting apps** — Use PixCraft's color-matching algorithm and pattern generation without building it from scratch.
* **Automations** — Connect with Zapier, Make, or n8n to automatically generate patterns when orders arrive.

## How it works

1. Send an image (base64 or URL) to the API along with target dimensions and a niche (curtains, mosaics, LEGO, etc.)
2. The API processes the image using perceptual color matching (CIE Lab Delta E)
3. You receive a complete pattern: materials list, assembly guide, and optional PDF

## Quick example

```bash theme={null}
curl -X POST https://www.pixcraft.es/api/v1/generate \
  -H "Authorization: Bearer px_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/photo.jpg",
    "niche": "curtains",
    "width_cm": 200,
    "height_cm": 250,
    "max_colors": 8
  }'
```

Response:

```json theme={null}
{
  "success": true,
  "niche": "curtains",
  "dimensions": {
    "width_cm": 200,
    "height_cm": 250,
    "cols": 133,
    "rows": 125,
    "total_units": 16625
  },
  "materials": [
    {
      "color_id": "blanco",
      "color_name": "Blanco",
      "hex": "#FFFFFF",
      "quantity": 10804,
      "percentage": 81.2
    }
  ],
  "assembly_guide": [...],
  "usage": {
    "calls_used": 244,
    "calls_remaining": 4756
  }
}
```

## Supported niches

The API dynamically supports all niches configured in PixCraft. Currently available:

| ID             | Name                | Unit     | Default size   |
| -------------- | ------------------- | -------- | -------------- |
| `curtains`     | Cortinas            | eslabon  | 1.5 × 2.0 cm   |
| `mosaics`      | Mosaicos            | tesela   | 2.0 × 2.0 cm   |
| `crossstitch`  | Punto de cruz       | punto    | 0.3 × 0.3 cm   |
| `lego`         | LEGO                | stud     | 0.8 × 0.8 cm   |
| `diamond`      | Diamond Painting    | diamante | 0.25 × 0.25 cm |
| `embroidery`   | Bordado             | puntada  | 0.4 × 0.4 cm   |
| `rugs`         | Alfombras           | nudo     | 0.6 × 0.6 cm   |
| `hama`         | Hama Beads          | cuenta   | 0.5 × 0.5 cm   |
| `crochet`      | Crochet tapiz       | punto    | 0.5 × 0.6 cm   |
| `paintnumbers` | Pintura por números | zona     | 1.0 × 1.0 cm   |
| `minecraft`    | Minecraft Pixel Art | bloque   | 1.0 × 1.0 cm   |
| `bottlecaps`   | Tapones de botella  | tapón    | 3.2 × 3.2 cm   |
| `knitting`     | Tricot              | punto    | 0.4 × 0.6 cm   |
| `latchhook`    | Latch Hook          | hebra    | 1.0 × 1.0 cm   |
| `stainedglass` | Vitral              | pieza    | 2.0 × 2.0 cm   |
| `needlepoint`  | Bordado en cañamazo | punto    | 0.35 × 0.35 cm |
| `macrame`      | Macramé             | nudo     | 0.8 × 0.8 cm   |
| `roblox`       | Roblox Pixel Art    | bloque   | 1.0 × 1.0 cm   |
| `quilling`     | Quilling            | tira     | 0.5 × 0.5 cm   |
| `weaving`      | Tejido en telar     | pasada   | 0.3 × 0.4 cm   |
| `petitpoint`   | Petit Point         | punto    | 0.15 × 0.15 cm |

When new niches are added to PixCraft, they automatically become available in the API — call `GET /api/v1/capabilities` to see the current list.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get your API key and make your first request in under 5 minutes.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/generate">
    Full documentation for every endpoint.
  </Card>
</CardGroup>
