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

# Get a Template

> A template's inputs, default columns, limits and sample rows.

Returns everything you need to run a template: its `inputs` (the fields of its form), the `columns` its table shows, its `limits` in plain words, and sample rows. No API key is needed.

```bash theme={null}
curl "https://api.spidra.io/api/templates/google-maps-leads"
```

The inputs of **Google Maps leads**, shortened:

```json theme={null}
[
  { "key": "query", "label": "Business type", "type": "text", "required": true, "example": "dentist" },
  { "key": "areas", "label": "Areas", "type": "list", "required": true, "example": ["Lekki, Lagos", "Ikeja, Lagos"], "maxItems": 25,
    "help": "One per line. Each area is one search (1 credit)." },
  { "key": "pages", "label": "Pages per area", "type": "number", "default": 1, "min": 1, "max": 5,
    "help": "Each page adds up to 20 more places and costs 1 credit." },
  { "key": "findContacts", "label": "Find emails and social links", "type": "boolean", "default": false },
  { "key": "language", "label": "Language", "type": "language", "default": "en", "advanced": true, "options": [ { "value": "en", "label": "English" } ] }
]
```

Send them as `inputs` by `key` when you [run the template](https://docs.spidra.io/api-reference/templates/run.md). Inputs with a `default` can be left out.

## Input types

| `type` | Send |
| - | - |
| `text`, `textarea` | A string. |
| `number` | A number between `min` and `max`. |
| `boolean` | `true` or `false`. |
| `select`, `country`, `language` | One of the `options` values. |
| `list` | An array of strings, up to `maxItems`. |
| `date` | `"2026-11-03"`. |
| `dateRange` | `{ "from": "2026-11-01", "to": "2026-11-30" }`. |
| `month`, `week`, `year` | `"2026-11"`, `"2026-W42"`, `"2026"`. |
| `airport` | An airport or city code such as `"LOS"`. [Look Up Airports](https://docs.spidra.io/api-reference/templates/airports.md) finds them. |

An input with `showIf` only applies when another input has one of the listed values, such as a week picker that applies only when `period` is `weekly`.

## Errors

`404` with `code: "TEMPLATE_NOT_FOUND"` when no template has this slug.


## OpenAPI

````yaml GET /templates/{slug}
openapi: 3.1.0
info:
  title: Spidra API
  version: 1.0.0
  description: >-
    Public API endpoints for web scraping via Spidra. Authenticate with
    `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.spidra.io/api
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /templates/{slug}:
    get:
      tags:
        - Templates
      summary: Get a Template
      description: >-
        One template with its inputs, columns, limits and a sample of its rows.
        No API key needed.
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
          description: The template's slug, such as `google-maps-leads`.
      responses:
        '200':
          description: The template.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  template:
                    allOf:
                      - $ref: '#/components/schemas/TemplateSummary'
                      - type: object
                        properties:
                          description:
                            type: string
                          limits:
                            type: array
                            items:
                              type: string
                            description: What the template can't do, in plain words.
                          inputs:
                            type: array
                            items:
                              $ref: '#/components/schemas/TemplateInput'
                          columns:
                            type: array
                            items:
                              type: object
                              properties:
                                key:
                                  type: string
                                  description: Path to the field in each row.
                                label:
                                  type: string
                                format:
                                  type: string
                          hasRows:
                            type: boolean
                          sample:
                            type: array
                            items:
                              type: object
                              additionalProperties: true
                          variants:
                            type: array
                            items:
                              type: object
                              additionalProperties: true
                            description: >-
                              Columns and samples that change with an input (for
                              example a different table for a different mode).
        '404':
          description: No template with this slug (`TEMPLATE_NOT_FOUND`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    TemplateSummary:
      type: object
      properties:
        slug:
          type: string
          description: The template's ID, used in every other call.
        version:
          type: integer
          description: Goes up when the template's inputs or output change.
        title:
          type: string
        summary:
          type: string
        site:
          $ref: '#/components/schemas/TemplateSite'
        categories:
          type: array
          items:
            type: string
        tool:
          type: string
          enum:
            - batch
            - search
            - crawl
            - map
            - parse
          description: The Spidra tool the template runs.
        featured:
          type: boolean
        gallery:
          type: boolean
          description: false for templates listed only under their site in the dashboard.
        status:
          type: string
          enum:
            - active
            - beta
        fields:
          type: array
          items:
            type: string
          description: The columns the results table shows by default.
        usesAi:
          type: boolean
          description: true when the template extracts with AI, which adds token credits.
        availability:
          type:
            - object
            - 'null'
          properties:
            state:
              type: string
              enum:
                - notice
                - 'off'
            message:
              type:
                - string
                - 'null'
          description: >-
            Null normally. `notice`: the template runs but has a message to
            read. `off`: paused, runs are refused.
    TemplateInput:
      type: object
      properties:
        key:
          type: string
          description: The name to use in `inputs`.
        label:
          type: string
        type:
          type: string
          description: >-
            text, number, boolean, select, list, date, country, language,
            airport and similar.
        required:
          type: boolean
        default:
          description: Used when you leave the input out.
        example: {}
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              label:
                type: string
          description: Allowed values for select, country and language inputs.
        min:
          type: number
        max:
          type: number
        maxItems:
          type: integer
        advanced:
          type: boolean
          description: Optional settings the dashboard folds away.
        help:
          type: string
        showIf:
          type: object
          description: The input only applies when another input has one of these values.
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
      required:
        - status
        - message
    TemplateSite:
      type:
        - object
        - 'null'
      properties:
        key:
          type: string
        name:
          type: string
        domain:
          type: string
      description: >-
        The site the template reads. Null for templates that work on any
        website.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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