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

# Buscar Página Web

> Aprende a buscar la página de una tienda por el dominio usando el endpoint GET /pages/{domain}.

## 📌 Endpoint

`GET /pages/{domain}`

Devuelve la página publicada de una tienda por el dominio.

***

## 🔐 Autenticación

* **Ruta pública**.
* La tienda vinculada al dominio necesita tener plan activo.

***

## 🧾 Parámetros de ruta

| Parámetro | Tipo | Obligatorio | Descripción |
| - | - | - | - |
| `domain` | string | Sí | Dominio de la tienda |

***

## ✅ Ejemplo de solicitud

```bash theme={null}
curl -X GET "https://api.cabrapi.com.br/v1/pages/minhaloja.com.br"
```

***

## 📦 Respuesta de éxito (200)

```json theme={null}
{
	"data": {
		"html": "<html>...</html>",
		"createdAt": "2026-03-02T20:00:00.000Z",
		"updatedAt": "2026-03-02T20:00:00.000Z",
		"store": {
			"ownerId": "USER_ID",
			"id": "STORE_ID"
		}
	}
}
```

***

## ⚠️ Posibles errores

* `400 INVALID_DATA` → parámetro `domain` inválido (vacío o mayor a 255 caracteres)
* `401 UNAUTHENTICATED` → tienda sin propietario asociado o conexión no disponible
* `403 NO_ACTIVE_SUBSCRIPTION` → la tienda vinculada al dominio está sin plan activo
* `404 DOMAIN_NOT_FOUND` → dominio inválido, no vinculado a ninguna tienda o inexistente (el middleware `ActivePlan` intercepta antes del controller)
* `404 PAGE_NOT_FOUND` → dominio válido, pero la tienda aún no publicó una página
* `429 RATE_LIMIT_EXCEEDED` → límite de solicitudes por minuto excedido
* `502 PAGE_SOURCE_UNAVAILABLE` → fallo al leer el contenido de la página en el almacenamiento de blobs
* `503 SERVICE_UNAVAILABLE` → servicio temporalmente no disponible


## OpenAPI

````yaml GET /pages/{domain}
openapi: 3.1.0
info:
  title: caBRAPI
  version: 1.0.0
servers:
  - url: https://api.cabrapi.com.br/v1
security: []
paths:
  /pages/{domain}:
    get:
      tags:
        - Store Page
      summary: Retrieve web page
      operationId: getPage
      parameters:
        - $ref: '#/components/parameters/Domain'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Page'
                required:
                  - data
                type: object
          description: Retrieve web page.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized (missing store owner or unavailable database).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden (inactive plan or insufficient permissions).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Upstream gateway or storage error.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Service unavailable.
      security: []
components:
  parameters:
    Domain:
      in: path
      name: domain
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    Page:
      description: Store web page (HTML served on domain).
      properties:
        createdAt:
          format: date-time
          type: string
        html:
          type: string
        store:
          properties:
            id:
              format: uuid
              type: string
            ownerId:
              format: uuid
              type: string
          required:
            - ownerId
            - id
          type: object
        updatedAt:
          format: date-time
          type: string
      required:
        - html
        - createdAt
        - updatedAt
        - store
      type: object
    Error:
      properties:
        code:
          example: STORE_NOT_FOUND
          type: string
      required:
        - code
      type: object

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.