apimarket
This SDK is an open-source development project that enables you to connect to ApiMarket services using Python.
- Benefits
Algorithm-based verifications.
Exponential retry mechanism.
Transparent saving to your backend, with default caching on your file system.
Typing support for seamless use in your IDE.
Installation
pip install apimarket
Getting Started
Copy a token in https://apimarket.mx/app/tokens
Choose the service you need https://apimarket.mx/marketplace and select the Python SDK
Test your code
import apimarket
# Copy the token from https://apimarket.mx/app/tokens
# You only need to configure the Token once.
apimarket.assemble(api_key="A7ee6195-4ff1-4ed2-bdf9-b950863fX3b9", sandbox=False)
# Choose the service you need https://apimarket.mx/marketplace
curp_details = apimarket.fetch_curp_details("LOOA531113HTCPBN07")
print(curp_details)
Save API KEY securily
There are three different ways to set the API key: you can set the API key as an environment variable in your shell, in the .env file, or call functions with your API key.
export APIMARKET_API_KEY="REPLACE-WITH-YOUR-API-HERE"
APIMARKET_API_KEY="REPLACE-WITH-YOUR-API-HERE"
Usage
Learn how to install and use the program through this playground.
Python
You can consult the full list on Python Docs.
Fetch CURP details
import apimarket
# You can configure the calls with apimarket.assemble(api_key: str, async_client:boolean=False, headers:dict[str,str], sandbox=False)
result = apimarket.fetch_curp_details("LOOA531113HTCPBN07")
print(result)
Fetch “Historial Laboral” details
import apimarket
# You can configure the calls with apimarket.assemble(api_key: str, async_client:boolean=False, headers:dict[str,str], sandbox=False)
result = apimarket.get_labor_history("CURP", "NSS")
print(result)
Multiple calls
import apimarket
# You can configure the calls with apimarket.assemble(api_key: str, async_client:boolean=False, headers:dict[str,str], sandbox=False)
apimarket.assemble(api_key="A7ee6195-4ff1-4ed2-bdf9-b950863fX3b9", sandbox=False)
CURP = ""
NSS= ""
curp_details = apimarket.fetch_curp_details(CURP, NSS)
labor_history = apimarket.get_labor_history(CURP, NSS)
print(result)
CLI
You can consult the full list on CLI Docs.
Fetch CURP details
apimarket -c LOOA531113HTCPBN07
Combine different requests
apimarket -c LOOA531113HTCPBN07 --get-rfc-from-curp LOOA531113HTCPBN07 | jq -s 'add'
Read a CSV with your customs fields
csvcut belongs to csvkit library
csvcut apimarket-consulta.csv -c 'CURP' | xargs -P 8 -I {} apimarket -c {} 2>"error.txt" | jq -s > curps.json
Servicios
Valida CURP API
Valida CURP API, es una API REST para la obtención y validación de los registros de nacimiento relacionados a la Clave Única de Registro de Población (CURP) en el Registro Nacional de Población (RENAPO) localizados en México en formato JSON. Este endpoint no usa un algoritmo, sino que consulta las fuentes oficiales. Este servicio cumple con la normativa de nuestra parte, te recomendamos leer nuestros nuestros términos y condiciones. Más información en https://apimarket.mx/marketplace/valida-curp
Historial Laboral IMSS API
Historial Laboral IMSS API, es una API REST para la obtención del historial Laboral registrado en el IMSS con sus semanas cotizadas, fechas de alta y baja, asi como el salario, razón social y registro patronal del empleador localizados en México en formato JSON. Este endpoint no usa un algoritmo, sino que consulta las fuentes oficiales. Más información en https://apimarket.mx/marketplace/consultar-historial-laboral
Dudas y opiniones
Correo
Mediante correo electrónico: soporte@apimarket.mx
Release files for apimarket 3.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apimarket-3.3.1.tar.gz | 98.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apimarket-3.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 428.4 kB
Release files / apimarket-3.3.1.tar.gz
| Download URL | apimarket-3.3.1.tar.gz |
|---|---|
| Size | 98.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74fb8214fe95408e9b7ecb1f94af83dcba4b239ea827221fdfe143d6c5ad9181
|
|
BLAKE2b-256 checksum How to use checksums |
992da2ded83261c762e33656a9948999b7bb5d2c0435c02d132802b44f6c9127
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|
Release files / apimarket-3.3.1-py3-none-any.whl
| Download URL | apimarket-3.3.1-py3-none-any.whl |
|---|---|
| Size | 330.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
485c14388a0afbd013d9a8230480962d3d6979252357fde7999b33518c303592
|
|
BLAKE2b-256 checksum How to use checksums |
ebb352cbcb628c862e0b5651d5b6b1a947cb9f7f79f7309081b2112e1cae4d3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.14
|