Skip to main content

licitapilot-python

Cliente oficial de Python para la API de LicitaPilot — licitaciones públicas de España (PLACSP y boletines autonómicos), estadísticas de baja temeraria, radar de vencimientos y rankings de adjudicatarios.

PyPI Python CI License: MIT

Datos de contratación pública española, listos para tu código en 10 segundos. La capa pública no necesita registro ni clave.

from licitapilot import LicitaPilot

lp = LicitaPilot()                       # sin clave
radar = lp.vencimientos(sector="45")     # contratos de construcción que van a re-licitarse
print(radar["total"], "vencimientos próximos")
for v in radar["items"][:5]:
    print(v["title"], "→ vence", v.get("contract_end_date"))

Instalación

pip install licitapilot

Dos capas

Capa Necesita clave Qué te da
Pública ❌ Radar de vencimientos, baja temeraria, rankings de adjudicatarios, ficha de empresa y de licitación por id — los mismos datos abiertos que ya publica la web
Empresa ✅ lp_live_… /v1: listado masivo de licitaciones (histórico + filtros) y tus matches personalizados por perfil

Consigue tu clave en licitapilot.com (plan Empresa).

Uso

"El foso": vencimientos, baja temeraria y rankings (público, sin clave)

lp = LicitaPilot()

lp.vencimientos()                  # hub global de contratos que caducan y volverán a salir
lp.vencimientos(sector="45")       # detalle de un sector (división CPV)
lp.baja_temeraria("45")            # cuánto se baja de media en construcción
lp.ranking_adjudicatarios("obras") # quién gana más en un sector
lp.empresa("acme-construcciones")  # ficha pública de una adjudicataria
lp.tender(123)                     # ficha pública de una licitación por id

Licitaciones y matches (plan Empresa, con clave)

El listado masivo y tus coincidencias personalizadas viven en /v1 y requieren clave:

lp = LicitaPilot(api_key="lp_live_…")   # o export LICITAPILOT_API_KEY=…

# Listado con filtros e histórico
page = lp.tenders(cpv="72", province="Madrid", state="open", limit=50)
for t in lp.iter_tenders(cpv="45", state="all", max_items=1000):
    print(t.id, t.title, t.url)

# Tus matches por perfil (scoring de relevancia + IA)
for m in lp.matches(limit=50):
    print(m.relevance_score, m.tender.title, m.status)

Sin clave, tenders() y matches() lanzan AuthRequiredError a propósito: son la parte de pago y la capa gratis no compite con ellas.

CLI

Instalar el paquete te da el comando licitapilot:

licitapilot tenders --cpv 45 --province Madrid
licitapilot vencimientos --sector 45
licitapilot baja --cpv 45
licitapilot ranking obras
licitapilot matches            # usa LICITAPILOT_API_KEY

licitapilot tenders --cpv 72 --json   # salida JSON para pipes

Ejemplos

Recetas listas para copiar en examples/:

Manejo de errores

from licitapilot import LicitaPilot, APIError, AuthRequiredError

try:
    LicitaPilot().matches()          # sin clave
except AuthRequiredError:
    ...                              # esta operación es de plan Empresa
except APIError as e:
    print(e.status_code, e.payload)  # la API devolvió 4xx/5xx

Desarrollo

pip install -e ".[dev]"
ruff check src tests
pytest -q            # tests con HTTP simulado, sin red

Sobre LicitaPilot

LicitaPilot es el copiloto de licitaciones públicas para empresas y autónomos en España: alertas por perfil, análisis con IA, radar de vencimientos, grafo de competidores y escritos jurídicos asistidos. Este SDK expone parte de esos datos de forma programática.

Licencia

MIT © LicitaPilot

Metadata

Release files for licitapilot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for licitapilot 0.1.0
File Size Uploaded
licitapilot-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for licitapilot 0.1.0
File Interpreter ABI Platform
licitapilot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / licitapilot-0.1.0.tar.gz

Download URL licitapilot-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5f779e64429047637ef8305631e3af36bdb897b24618a8d4676c94e655d26e93
BLAKE2b-256 checksum
How to use checksums
81071ff7f46032e7070a4f523e722069638f3d35a53bf9cc55166fca62efc249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release files / licitapilot-0.1.0-py3-none-any.whl

Download URL licitapilot-0.1.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac9a6914a78f92d586d80154e69597c677e08bd89774d75ca97aefb50a43d3e4
BLAKE2b-256 checksum
How to use checksums
a081d1d0bb063f7925eed9f256577fb8cd8f78232d01437ca42b82fa6ad23779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page