Skip to main content

APIEmpresas.es - SDK para Python

SDK oficial para consultar la API de APIEmpresas.es desde Python 3.7 o superior.

Instalación

pip install apiempresas

Uso

from apiempresas import ApiEmpresas, ApiError

api = ApiEmpresas('TU_API_KEY')

# Datos de una empresa (devuelve directamente el objeto de la empresa)
empresa = api.companies.get('A15075062')
print(empresa['name'])

# Con administradores y cargos (Pro/Business)
empresa = api.companies.get('A15075062', admin=True)

# Varias empresas por nombre, con paginación (devuelve data y meta)
pagina = api.companies.search_multiple('software', limit=20)
siguiente = pagina['meta'].get('next_cursor')
if siguiente:
    pagina = api.companies.search_multiple('software', cursor=siguiente)

# Consulta múltiple (devuelve data y meta)
lote = api.companies.batch(['A15075062', 'A46103834'])

# Match (Business): el sector del vendedor es obligatorio
match = api.companies.match('A15075062', 'software')

# Radar de empresas nuevas (Business)
nuevas = api.companies.radar(province='Madrid', range='semana')

Los métodos devuelven el contenido de data, salvo cuando la respuesta trae también meta (batch, search_multiple, radar), que devuelven la respuesta completa.

Sandbox

Para probar sin gastar consultas, con tu misma API Key y datos simulados:

api = ApiEmpresas('TU_API_KEY', base_url='https://apiempresas.es/api/sandbox/v1')

Errores

try:
    api.companies.get('A15075062')
except ApiError as e:
    print(e.status)      # código HTTP
    print(str(e))        # mensaje legible
    print(e.code)        # p. ej. QUOTA_EXCEEDED, TOO_MANY_REQUESTS, API_KEY_INVALID
    print(e.error_code)  # campo "error" de la respuesta (como en versiones anteriores)

Un 429 con code == 'TOO_MANY_REQUESTS' se resuelve esperando y reintentando; con QUOTA_EXCEEDED no: hay que recargar saldo o cambiar de plan.

Licencia

MIT

Metadata

Release files for apiempresas 1.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 apiempresas 1.1.0
File Size Uploaded Provenance Actions
apiempresas-1.1.0.tar.gz 5.2 kB Without provenance Details for apiempresas-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.9 kB

Release files / apiempresas-1.1.0.tar.gz

Download URL apiempresas-1.1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5da92d77e4b4a1e56a9afc6fce152560e0b8ec5f5012af792678b161df4d12fd
BLAKE2b-256 checksum
How to use checksums
e373353e76fbe0558570983ccc3d8c0dea10f08493124641fa4c671514ad1c1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / apiempresas-1.1.0-py3-none-any.whl

Download URL apiempresas-1.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc0a706842082e8fb962d52a409de9b34c21f60ed32ebb0ea477957b8840bad4
BLAKE2b-256 checksum
How to use checksums
eb7a190f8dd71581a9ba94954183a5a7207c5f88b7aa6e4ce36766d1f08d9939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for apiempresas 1.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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