---
title: "Buscar fotos y vídeos de archivo gratuitos"
description: "Busca fotos o vídeos en Pixabay para usarlos en un sitio."
canonical: "https://atelier201.com/docs/es/api/media/stock-search"
updated: "2026-11-06"
---

# Buscar fotos y vídeos de archivo gratuitos

Requiere `sites:read`. No consume créditos ni guarda nada.

Cada resultado incluye `provider`, `id`, el tamaño, una descripción, el autor y `preview_url`. La vista previa solo sirve para consultar el resultado: un sitio nunca enlaza a ella. [Importa](/docs/api/media/stock-import) el que elijas para copiarlo en los recursos multimedia del sitio.

`providers` indica qué bibliotecas se pueden consultar en ese momento, por ejemplo `{ "pixabay": "available" }`. [Consultar la lista de modelos](/docs/api/media/models) devuelve la misma información antes de hacer una búsqueda. Si se indica una biblioteca que no está disponible, la solicitud se rechaza con `service_unavailable`; su nombre aparece en `details.provider` y las bibliotecas disponibles, en `details.providers`.

Las consultas en inglés devuelven más resultados. Por ahora, los resultados proceden únicamente de Pixabay, por lo que `provider` siempre es `pixabay`. Las respuestas se almacenan en caché durante un día.

Se permiten como máximo 30 búsquedas e importaciones por minuto y espacio de trabajo. Si se supera el límite o la propia biblioteca está ocupada (Atelier201 comparte una única cuota), la respuesta será `429 rate_limited` e indicará cuánto hay que esperar en `Retry-After` y en `details.retry_after_seconds`: espera ese tiempo y vuelve a intentarlo.

```http
GET https://api.atelier201.com/v1/sites/{site_id}/media/stock
```

## Authorizations

- `Authorization` (bearer, in header, required)

## Path parameters

- `site_id` (`string`, required): El ID del sitio o su slug (la dirección antes de .atelier201.page).

## Query parameters

- `query` (`string`, required, length: `1–100 chars`): Qué quieres buscar. Las búsquedas en inglés suelen ofrecer más resultados.
- `kind` (`enum<string>`, one of: `image, video`): image (valor predeterminado) o video.
- `orientation` (`enum<string>`, one of: `landscape, portrait, square`)
- `provider` (`enum<string>`, one of: `pixabay`): La biblioteca. Por ahora, Pixabay es la única disponible y es la predeterminada.
- `per_page` (`integer`, range: `1–30`)
- `page` (`integer`, range: `1–50`)
- `locale` (`string`, length: `≤ 10 chars`): El idioma de la consulta, por ejemplo, fr-FR.

## Response

**200**: Buscar fotos y vídeos de stock gratuitos

- `data` (`object`, required)
- `data.results` (`object[]`, required)
- `data.results.provider` (`enum<string>`, required, one of: `pixabay`)
- `data.results.id` (`string`, required)
- `data.results.kind` (`enum<string>`, required, one of: `image, video`)
- `data.results.width` (`number`, required)
- `data.results.height` (`number`, required)
- `data.results.duration` (`number`)
- `data.results.description` (`string`, required)
- `data.results.author` (`string`, required)
- `data.results.author_url` (`string,null`, required)
- `data.results.page_url` (`string`, required)
- `data.results.preview_url` (`string`, required): Solo para ver el resultado. El sitio nunca enlaza a él: importa el archivo.
- `data.total` (`integer`, required, range: `-9007199254740991–9007199254740991`)
- `data.page` (`integer`, required, range: `-9007199254740991–9007199254740991`)
- `data.attribution` (`string`, required)
- `data.providers` (`Record<string, enum<string>>`, required): Cada biblioteca de stock y si se puede buscar en ella en este momento, por ejemplo, { pixabay: available }.
- `data.next_action` (`string`, required)
- `request_id` (`string`, required)

```json
{
  "data": {
    "results": [
      {
        "provider": "pixabay",
        "id": "<string>",
        "kind": "image",
        "width": 123.45,
        "height": 123.45,
        "duration": 123.45,
        "description": "<string>",
        "author": "<string>",
        "author_url": null,
        "page_url": "<string>",
        "preview_url": "<string>"
      }
    ],
    "total": 123,
    "page": 123,
    "attribution": "<string>",
    "providers": {},
    "next_action": "<string>"
  },
  "request_id": "<string>"
}
```

**400**: Códigos posibles: invalid_request, unknown_field, invalid_parameter, invalid_cursor

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**401**: Códigos posibles: authentication_required, invalid_api_key, api_key_expired, api_key_revoked

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**402**: Códigos posibles: insufficient_credits

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**403**: Códigos posibles: insufficient_scope, feature_not_available, admin_required

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**404**: Códigos posibles: resource_not_found

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**409**: Códigos posibles: conflict, result_not_ready, idempotency_key_reused

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**410**: Códigos posibles: result_expired

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**413**: Códigos posibles: request_too_large

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**422**: Códigos posibles: request_too_large_for_plan

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**429**: Códigos posibles: rate_limited

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**500**: Códigos posibles: internal_error

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**503**: Códigos posibles: service_unavailable

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `error.details` (`Record<string, object>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>",
    "details": {}
  },
  "request_id": "<string>"
}
```

**Example request**

```bash
curl --request GET \
  --url 'https://api.atelier201.com/v1/sites/<site_id>/media/stock?query=<query>' \
  --header 'Authorization: <api-key>'
```
