mercadolivre-public-api

1.1.0 • Public • Published

Mercado Livre Public API

Consultas básicas do Mercado Livre

Instalação

npm install mercadolivre-public-api

import mercadolivre from 'mercadolivre-public-api'

Como utilizar

Define o sellerId

mercadolivre.setSellerId(seller_id)

Retorna total de itens

let total = await mercadolivre.getTotalItens()

Retorna itens utilizando Offset

offset = 0;
let itens = await mercadolivre.getItens(offset)

Retorna todos os Itens

async function getItensComplete() {
    let offset = 0;
    let itens = null
    let full_itens = []
    this.total = await mercadolivre.getTotalItens()

    while (this.total >= full_itens.length) {
        let itens = await mercadolivre.getItens(offset)
        full_itens = full_itens.concat(await mercadolivre.getItens(offset));
        offset += 50;
    } 
} 

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.02latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.02
1.0.10
1.0.00

Package Sidebar

Install

npm i mercadolivre-public-api

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

2.78 kB

Total Files

3

Last publish

Collaborators

  • sr2ds