Skip to main content

Python client library for Mercado Radar API

Project description

Mercado Radar - SDK

The Mercado Radar SDK library provides convenient access to the Mercado Radar API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

For more information visit the API Documentation.

Installation

You don't need the source code unless you want to modify the package for contribution. If you just want to use the package, just run:

pip install mercadoradar

Usage

Authentication

The library needs to be configured with your users's API Token which you can get it through suporte@mercadoradar.com.br

  1. Set it as the MERCADORADAR_TOKEN environment variable before using the library:
export MERCADORADAR_TOKEN='YOUR_API_TOKEN'
  1. Or set directly on initialization:
from src.mercadoradar import MercadoRadar

mercadoradar = MercadoRadar(token='YOUR_API_TOKEN')

Resources

All resources have the methods:

  • create
  • retrieve
  • update
  • delete
  • list
Resource Module
Account account
Attribute Type attribute_type
Attribute Value attribute_value
Brand brand
Category category
Filter filter
Product product
Product Attribute Value product_attribute_value
Product History product_history
Search search
Seller seller
Site site
User user

Examples

from mercadoradar import MercadoRadar

mercadoradar = MercadoRadar(token="YOUR_TOKEN")

products = mercadoradar.product.list()
out_of_stock_products = mercadoradar.product.list(status=["OUT_OF_STOCK"])
my_product = mercadoradar.product.retrieve(id=1)

sellers = mercadoradar.seller.list()
my_seller = mercadoradar.seller.retrieve(id=1)

brazil_sites = mercadoradar.site.list(country="BRAZIL")

my_product_history = mercadoradar.product_history.list(product_id=1)

Requirements

Python 3.10.*

Development

  1. Install dependencies
poetry env use python3.10
poetry config virtualenvs.in-project true
poetry install

Publish

poetry config pypi-token.pypi <TOKEN>
poetry build
poetry publish --build

Licence

MIT License

Copyright (c) 2025 Mercado Radar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

mercadoradar-2.0.2.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mercadoradar-2.0.2-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file mercadoradar-2.0.2.tar.gz.

File metadata

  • Download URL: mercadoradar-2.0.2.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-17-generic

File hashes

Hashes for mercadoradar-2.0.2.tar.gz
Algorithm Hash digest
SHA256 6db9e8289cfc82ecdc5d098b6229a332624b299935191c716b38fd7d241d6e0d
MD5 71851fb7372e1ee7c71e6be329bbe0b4
BLAKE2b-256 32f6212a70e7d8efff5ccb3e360beae191edb105287f5b7361f79272f9fb994e

See more details on using hashes here.

File details

Details for the file mercadoradar-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: mercadoradar-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-17-generic

File hashes

Hashes for mercadoradar-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eedd3277022140b5fe06bac21e166565e38b87469aafb9f9f8222e6b04cae95a
MD5 97486784f5ab9adf14626fc13b6c2078
BLAKE2b-256 dfba5017a63f29955e8cd9f7d6665f9dc291037d20d33a9dffe91f4c1dd2fbb3

See more details on using hashes here.

Supported by

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