Skip to main content

API Market SDK for Python Development

Project description

PyPI-Server Twitter Project generated with PyScaffold

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

  1. Copy a token in https://apimarket.mx/app/tokens

  2. Choose the service you need https://apimarket.mx/marketplace and select the Python SDK

  3. 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)

Fetch INFONAVIT subaccount by NSS.

import apimarket
NSS = ""
result = apimarket.get_infonavit_subaccount_by_nss(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

WhatsApp: https://api.whatsapp.com/message/CEUT72XQ5FKGP1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apimarket-3.3.1.tar.gz (98.0 kB view details)

Uploaded Source

Built Distribution

apimarket-3.3.1-py3-none-any.whl (330.3 kB view details)

Uploaded Python 3

File details

Details for the file apimarket-3.3.1.tar.gz.

File metadata

  • Download URL: apimarket-3.3.1.tar.gz
  • Upload date:
  • Size: 98.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for apimarket-3.3.1.tar.gz
Algorithm Hash digest
SHA256 74fb8214fe95408e9b7ecb1f94af83dcba4b239ea827221fdfe143d6c5ad9181
MD5 41c5d85c7b078a87de06a814b0497b5f
BLAKE2b-256 992da2ded83261c762e33656a9948999b7bb5d2c0435c02d132802b44f6c9127

See more details on using hashes here.

File details

Details for the file apimarket-3.3.1-py3-none-any.whl.

File metadata

  • Download URL: apimarket-3.3.1-py3-none-any.whl
  • Upload date:
  • Size: 330.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for apimarket-3.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 485c14388a0afbd013d9a8230480962d3d6979252357fde7999b33518c303592
MD5 954f171ad0413d08ec649520233a43ff
BLAKE2b-256 ebb352cbcb628c862e0b5651d5b6b1a947cb9f7f79f7309081b2112e1cae4d3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page