Spanish Tax Rulings Scraper (DGT Binding Consultations)
Pricing
Pay per event
Spanish Tax Rulings Scraper (DGT Binding Consultations)
Search and export binding tax rulings from the Spanish Tax Directorate (DGT): full answer, facts, laws and articles cited. Monitor new rulings for advisors.
Search and export binding tax rulings (consultas vinculantes) from the Spanish Tax Directorate (DGT, Ministry of Finance): full answer text, facts, question, laws and articles cited. Monitor new rulings for tax advisors, law firms and legal AI. Versión en español más abajo.
Use cases
- Tax advisers: search binding rulings (consultas vinculantes) of the Spanish tax authority by keyword
- Feed accounting and tax-law assistants with official criteria
- Monitor new rulings on VAT, income tax and corporate tax
- Build searchable knowledge bases for tax teams
English
What does it do?
The Actor queries the official DGT doctrine database (Petete) and returns each ruling as a structured record. It is the fastest way to build a searchable base of Spanish tax doctrine or to get alerts when the DGT answers a question about a given law.
Use cases:
- Tax advisory and gestorías: find how the DGT interprets a rule (VAT, IRPF, inheritance tax, corporate tax).
- Legal AI / RAG: feed full rulings with cited laws and articles into a retrieval pipeline.
- Monitoring:
soloNuevasemits only rulings you have not collected before. - Research: filter by date range, ruling type and free text or law.
Input
An empty input {} widens the date window until it finds results and returns up to 10 rulings.
| Field | Description |
|---|---|
textoLibre | Free-text search. |
numeroConsulta | A specific ruling number, e.g. V5441-26. |
normativa | Law or regulation referenced. |
cuestionPlanteada, descripcionHechos | Search in the question or facts. |
fechaDesde / fechaHasta | Date range (YYYY-MM-DD). |
tipos | vinculantes and/or generales. |
soloCriterioInteres | Only rulings flagged as interesting criterion. |
incluirContestacion | Include the full answer text (default true). |
maxResultados | Cap (default 100). |
soloNuevas | Only rulings not seen before. |
resumenIA | Optional AI summary. |
{ "textoLibre": "donaciones", "fechaDesde": "2026-01-01", "maxResultados": 25 }
Output
Real item from a run (answer text truncated here; the dataset has the full text):
{"tipo": "vinculante","numeroConsulta": "V5441-26","organo": "SG de Impuestos Patrimoniales, Tasas y Precios Públicos","fechaSalida": "2026-08-06","normativa": "Ley 29/1987 Impuesto sobre Sucesiones y Donaciones - 3.1 - 5 - 6.1 ...","leyesCitadas": ["Ley 29/1987", "RD 1629/1991", "Ley 22/2009"],"articulosCitados": ["3.1", "5", "6.1", "6.2", "9", "24.2", "30", "67", "32.1", "32.2", "48", "55"],"descripcionHechos": "El consultante va a recibir de sus padres transferencias de dinero de forma periódica...","cuestionPlanteada": "Tributación de las transferencias periódicas en el Impuesto sobre Sucesiones y Donaciones.","contestacion": "En relación con las cuestiones planteadas este Centro Directivo informa lo siguiente: ...","longitudContestacion": 8026,"idDocumento": "70284","urlBuscador": "https://petete.tributos.hacienda.gob.es/consultas/","fuente": "Ministerio de Hacienda - Direccion General de Tributos (petete.tributos.hacienda.gob.es)","extraidoEn": "2026-10-31T18:10:45.020Z","hash": "224a09482d0759d1e7528d35f7f59fcdba776a7b907f323386a9a7258a6f225a"}
Pricing (pay per event)
| Event | Price | Per 1,000 |
|---|---|---|
Ruling with full answer (consulta) | $0.006 | $6.00 |
Ruling, metadata only (consulta-metadatos) | $0.001 | $1.00 |
AI summary (resumen-ia, optional) | $0.005 | $5.00 |
Set a maximum spend per run; the Actor stops and keeps what it saved.
Integrations (Make, Zapier, Google Sheets)
- Make: add the Apify module "Run an Actor" (Actor
Flets_sv/dgt-consultas-vinculantes), paste the input JSON, chain "Get Dataset Items" and map the fields to Google Sheets, Slack, Airtable or your CRM. - Zapier: the Apify app offers "Run Actor" and "Fetch Dataset Items". Add a Schedule trigger and send each row to Gmail, Slack or Notion.
- Google Sheets: enable the official Google Sheets integration in the Actor's Integrations tab to append every run to a sheet, or call
https://api.apify.com/v2/acts/Flets_sv~dgt-consultas-vinculantes/run-sync-get-dataset-items?format=csvwith POST and your input from Apps Script (UrlFetchApp). - API and webhooks: start the Actor from the REST API, use Schedules for recurring runs and add a webhook to notify your system when a run finishes.
Input to paste into Make or Zapier:
{"textoLibre":"criptomonedas","tipos":["vinculantes"],"soloCriterioInteres":false,"incluirContestacion":true,"maxResultados":5,"soloNuevas":false,"diasRetencion":365,"pausaMs":1000,"resumenIA":false}
FAQ
Is it legal? The rulings are public administrative doctrine published by the Ministry of Finance. Reuse is allowed under Law 37/2007 on reuse of public sector information; cite the source (each record has fuente). The Actor pauses between requests to respect the site. This is not tax or legal advice.
Do I get the full answer? Yes, by default. Turn off incluirContestacion for a cheaper metadata-only list.
Binding vs general? Binding rulings (V...) bind the tax administration for the case; general ones (NV...) are informative. Choose with tipos.
Is it in English? The source is in Spanish. Use resumenIA or your own LLM to translate or summarise.
Integrations
- API / SDKs:
POST https://api.apify.com/v2/acts/flets_sv~dgt-consultas-vinculantes/runs, JavaScript and Python clients. - Make, Zapier, n8n, Google Sheets: weekly run plus alert on new rulings.
- RAG: load the dataset into Pinecone, Qdrant, LangChain or LlamaIndex.
- MCP / AI agents: call it from Claude or any MCP client via
https://mcp.apify.com. - Export as JSON, CSV, Excel or XML.
Data source and license
Ministerio de Hacienda, Dirección General de Tributos (petete.tributos.hacienda.gob.es). Independent Actor, not affiliated with the Spanish administration.
Español
¿Qué hace?
Busca en la base oficial de doctrina de la Dirección General de Tributos (Petete) y devuelve cada consulta como registro estructurado: órgano, fecha, descripción de los hechos, cuestión planteada, contestación completa, leyes y artículos citados. Pensado para asesorías fiscales, gestorías, despachos de abogados y proyectos de IA jurídica.
Input
Con {} amplía la ventana de fechas hasta encontrar resultados y devuelve hasta 10 consultas. Campos: textoLibre, numeroConsulta, normativa, cuestionPlanteada, descripcionHechos, fechaDesde, fechaHasta, tipos (vinculantes/generales), soloCriterioInteres, incluirContestacion, maxResultados, soloNuevas, resumenIA.
Output
Ver el ejemplo real de la sección inglesa.
Precios (pago por evento)
| Evento | Precio | Por 1.000 |
|---|---|---|
Consulta con contestación (consulta) | 0,006 $ | 6,00 $ |
Consulta solo metadatos (consulta-metadatos) | 0,001 $ | 1,00 $ |
Resumen con IA (resumen-ia, opcional) | 0,005 $ | 5,00 $ |
Integraciones (Make, Zapier, Google Sheets)
- Make: añade el módulo de Apify «Run an Actor» (Actor
Flets_sv/dgt-consultas-vinculantes), pega el input JSON y encadena «Get Dataset Items»; después mapea los campos a Google Sheets, Slack, Airtable o tu CRM. - Zapier: la app de Apify ofrece «Run Actor» y «Fetch Dataset Items». Ponle un disparador de horario y envía cada fila a Gmail, Slack o Notion.
- Google Sheets: en la pestaña Integrations del Actor activa la integración oficial con Google Sheets para añadir cada ejecución a una hoja, o llama desde Apps Script (
UrlFetchApp) ahttps://api.apify.com/v2/acts/Flets_sv~dgt-consultas-vinculantes/run-sync-get-dataset-items?format=csvcon POST y tu input. - API y webhooks: lanza el Actor por API REST, programa ejecuciones (Schedules) y avisa a tu sistema con un webhook al terminar.
Ejemplo de input para pegar en Make o Zapier:
{"textoLibre":"criptomonedas","tipos":["vinculantes"],"soloCriterioInteres":false,"incluirContestacion":true,"maxResultados":5,"soloNuevas":false,"diasRetencion":365,"pausaMs":1000,"resumenIA":false}
Preguntas frecuentes
¿Es legal? Son doctrina administrativa pública del Ministerio de Hacienda, reutilizable según la Ley 37/2007; cita la fuente (fuente en cada registro). El Actor espera entre peticiones para no sobrecargar el sitio. No es asesoramiento fiscal ni jurídico.
¿Cómo recibo solo las nuevas? Programa el Actor con soloNuevas.
Integración
API de Apify, Make, Zapier, n8n, Google Sheets, bases vectoriales y agentes de IA vía MCP (https://mcp.apify.com). Exporta a JSON, CSV, Excel o XML.
Fuente y licencia
Ministerio de Hacienda, Dirección General de Tributos. Actor independiente, sin afiliación con la Administración.
Ejemplos de uso / Usage examples
Example output (real run, 2026-11-05)
First rows returned by a real run of this Actor on 2026-11-05 (shortened columns, values truncated):
| numeroConsulta | fechaSalida | organo | normativa | cuestionPlanteada |
|---|---|---|---|---|
| V0002-26 | 2026-01-08 | SG de Impuestos Especiales y de Tributos sobre el Comerci... | Ley 7/2022, de 8 de abril, de residuos y suelos contamina... | La consultante plantea una serie de preguntas en relación... |
| V0007-26 | 2026-01-08 | SG de Impuestos sobre las Personas Jurídicas | LIS Ley 27/2014 art. 10-3 y 11 | - ¿Cómo tributa esta subvención en el Impuesto sobre Soci... |
| V0012-26 | 2026-01-08 | SG de Impuestos Especiales y de Tributos sobre el Comerci... | Ley 38/1992 arts. 65-3; 66-1,d); 68 y 69 | Sujeción al Impuesto Especial sobre Determinados Medios d... |
Copy-paste inputs
1. Binding rulings about donations since January
{"textoLibre": "donaciones","fechaDesde": "2026-01-01","maxResultados": 25}
2. Only rulings flagged as of special interest
{"soloCriterioInteres": true,"tipos": ["vinculantes"],"maxResultados": 50}
Call it from your code (Apify API)
curl -X POST "https://api.apify.com/v2/acts/Flets_sv~dgt-consultas-vinculantes/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{"textoLibre": "donaciones", "fechaDesde": "2026-01-01", "maxResultados": 25}'
from apify_client import ApifyClientclient = ApifyClient("YOUR_API_TOKEN")run = client.actor("Flets_sv/dgt-consultas-vinculantes").call(run_input={"textoLibre": "donaciones", "fechaDesde": "2026-01-01", "maxResultados": 25})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item)
No code? Use the Apify modules for Make and Zapier (run the Actor, then fetch dataset items), or the Google Sheets integration in the Actor's Integrations tab to append each run to a sheet.