# mercadolivre-public-api

> API para consultas publicas do Mercado Livre

Latest version **1.1.0** (published 2019-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install mercadolivre-public-api
pnpm add mercadolivre-public-api
yarn add mercadolivre-public-api
bun add mercadolivre-public-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-03-19 |
| First published | 2019-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Silva |
| Maintainers | sr2ds |
| Keywords | mercadolivre |

## Links

- npm: https://www.npmjs.com/package/mercadolivre-public-api
- Repository: https://github.com/sr2ds/mercadolivre-public-api
- Homepage: https://github.com/sr2ds/mercadolivre-public-api#readme
- Issues: https://github.com/sr2ds/mercadolivre-public-api/issues
- npm.io page: https://npm.io/package/mercadolivre-public-api

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.18.0

## Recent versions

- 1.1.0 (latest) — 2019-03-19
- 1.0.1 — 2019-03-07
- 1.0.0 — 2019-03-07

## README

# Mercado Livre Public API

Consultas básicas do Mercado Livre <br>

## 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;
    } 
} 
```

---
_Source: https://npm.io/package/mercadolivre-public-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
