# Preguntas del examen teórico DGT · API de TestCarnet (`testcarnet/dgt-driving-test-questions`) Actor

Preguntas del teórico de la DGT con la respuesta correcta, la explicación y la norma, por permiso y tema, en JSON. De TestCarnet (testcarnet.com). Pagas solo por las preguntas que recibes.

- **URL**: https://apify.com/testcarnet/dgt-driving-test-questions.md
- **Developed by:** [TestCarnet](https://apify.com/testcarnet) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 preguntas

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Preguntas del examen teórico DGT · API de TestCarnet

Preguntas del examen teórico del carnet de conducir en España (DGT) en JSON, listas para tu app, tu campus, tu chatbot o tu herramienta de estudio. Cada pregunta trae sus opciones, la **respuesta correcta**, una **explicación** clara y la **norma** en la que se basa. Eliges el permiso, el tema y cuántas quieres, y **pagas solo por las preguntas que recibes**.

Las preguntas son de **[TestCarnet](https://testcarnet.com)**, la web para preparar el teórico de la DGT: test gratis con el formato real del examen, temario por temas, señales y guías. Están redactadas y revisadas con la normativa vigente: el Reglamento General de Circulación con su reforma de 2026 (Real Decreto 518/2026), la Ley de Tráfico y el catálogo de señales de 2025 (Real Decreto 465/2025). En noviembre de 2026 revisamos el banco entero, pregunta a pregunta.

### Qué recibes

- **Todos los permisos**: B (coche), AM (ciclomotor), A1 y A2 (moto), C (camión), D (autobús) y B+E (remolque).
- **Por temas**: señales, prioridad de paso, velocidad, adelantamientos, alcohol y drogas, primeros auxilios, el vehículo y muchos más.
- **Respuesta correcta y explicación** escritas por TestCarnet, con la **norma** (por ejemplo, `Art. 46 RGC`).
- **Imágenes** en las preguntas que las necesitan (señales y situaciones de tráfico), con su dirección completa.
- **Dos orígenes**: las preguntas de redacción propia de TestCarnet y las del **test oficial que publica la DGT**, cada una marcada con su origen. Puedes pedir solo uno de los dos.
- **Sin repetidas** en una misma ejecución: cada pregunta que se te cobra es distinta.

### Qué tienes que elegir

| Campo | Qué es |
| --- | --- |
| Permiso | B, AM, A1/A2, C, D o B+E. |
| Tema | Un tema o todos. Los temas específicos (motocicletas, ciclomotores, camiones, autobuses y remolques) van siempre con su propio permiso. |
| Origen de las preguntas | Las dos, solo las de TestCarnet o solo las del test oficial de la DGT. |
| Número de preguntas | Hasta 500 preguntas distintas por ejecución. |
| Con la respuesta y la explicación | Desactívalo para recibir solo la pregunta y sus opciones. |

### Qué devuelve

Cada pregunta del conjunto de datos es así:

```json
{
  "id": "tc-velocidad-035",
  "permit": "B",
  "topic": "velocidad",
  "topicName": "Velocidad",
  "prompt": "En una calle, un autobús urbano está detenido en su parada y se están bajando viajeros. ¿Qué debe hacer al aproximarse?",
  "options": [
    { "id": "a", "letter": "A", "text": "Mantener la velocidad, porque esa obligación solo rige con los autobuses escolares." },
    { "id": "b", "letter": "B", "text": "Adelantarlo cuanto antes, antes de que reanude la marcha." },
    { "id": "c", "letter": "C", "text": "Moderar la velocidad, porque algún viajero puede cruzar por delante del autobús." }
  ],
  "correctOptionId": "c",
  "correctAnswer": "Moderar la velocidad, porque algún viajero puede cruzar por delante del autobús.",
  "explanation": "La norma obliga a moderar la velocidad, y a detenerte si es preciso, al aproximarte a un autobús en situación de parada, sobre todo si es de transporte escolar. Quien acaba de bajar puede cruzar la calzada por delante del autobús, oculto a tu vista hasta el último momento.",
  "reference": "Art. 46 RGC",
  "imageUrl": null,
  "source": "testcarnet",
  "sourceLabel": "TestCarnet (redacción propia)",
  "attribution": "Pregunta y explicación de TestCarnet (https://testcarnet.com)."
}
```

Puedes descargar los resultados en JSON, CSV, Excel o XML, o leerlos con la API de Apify.

### Precio

Pagas por pregunta entregada: un cobro por cada pregunta distinta del conjunto de datos. Pon un coste máximo por ejecución y el Actor nunca pide más preguntas de las que cubre.

### Condiciones de uso

- Las preguntas con `"source": "dgt"` son del test oficial que publica la Dirección General de Tráfico (DGT). Si las enseñas, hazlo **sin cambios** y **citando la fuente**; el campo `attribution` trae un texto listo para usar.
- Las explicaciones son siempre de TestCarnet.
- Puedes usar las preguntas en tus productos, pero no copiar ni volver a publicar el banco entero. Para que esto sea justo para todos, el Actor envía a TestCarnet tu identificador de usuario de Apify: si en 30 días recibes una parte muy grande del banco, no recibes más hasta que pase ese plazo.
- Condiciones completas en [testcarnet.com/legal/api](https://testcarnet.com/legal/api/). TestCarnet es un proyecto independiente y no está vinculado a la DGT.
- ¿Necesitas el banco completo dentro de tu producto o mucho volumen? Escríbenos a **hola@testcarnet.com**: tenemos licencias del banco.

***

**In English:** Spanish DGT driving theory test questions as JSON, with the correct answer, an explanation and the legal reference, by licence (B, AM, A1/A2, C, D, B+E) and topic, from [TestCarnet](https://testcarnet.com). Questions are in Spanish. You pay per question delivered. Questions marked `"source": "dgt"` come from the official test published by Spain's DGT and must be shown unchanged, citing the source.

# Actor input Schema

## `permit` (type: `string`):

Permiso para el que son las preguntas (el B es el de coche).

## `topic` (type: `string`):

Solo preguntas de este tema. Los temas específicos (motocicletas, ciclomotores, camiones, autobuses y remolques) van siempre con su propio permiso.

## `source` (type: `string`):

Las de redacción propia de TestCarnet, las del test oficial que publica la DGT o las dos.

## `maxQuestions` (type: `integer`):

Preguntas distintas que quieres en esta ejecución (hasta 500). Cada una se cobra una vez.

## `includeAnswers` (type: `boolean`):

Desactívalo para recibir solo la pregunta y sus opciones (por ejemplo, para corregir tú las respuestas después).

## Actor input object example

```json
{
  "permit": "B",
  "topic": "all",
  "source": "all",
  "maxQuestions": 30,
  "includeAnswers": true
}
```

# Actor output Schema

## `preguntas` (type: `string`):

Conjunto de datos con todas las preguntas en JSON (también se puede descargar en CSV, Excel o XML).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("testcarnet/dgt-driving-test-questions").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("testcarnet/dgt-driving-test-questions").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call testcarnet/dgt-driving-test-questions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,testcarnet/dgt-driving-test-questions"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ukepuWBltLOFdoGXS/builds/rlNE9r91GUucE59rU/openapi.json
