PHPackages                             wandesnet/mercado-livre - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. wandesnet/mercado-livre

ActiveLibrary[API Development](/categories/api)

wandesnet/mercado-livre
=======================

PHP SDK for integration with Mercado Livre

1.2.5(2y ago)125MITPHPPHP ^8.1.0

Since Apr 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wandesnet/mercado-livre)[ Packagist](https://packagist.org/packages/wandesnet/mercado-livre)[ RSS](/packages/wandesnet-mercado-livre/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

Introduction
------------

[](#introduction)

This integration package with Mercado Livre (not the official one)

Required
--------

[](#required)

- **PHP 8.1+**

Installation
------------

[](#installation)

```
composer require wandesnet/mercado-livre

```

Usage
-----

[](#usage)

Create a class `Meli` extends from `Meli Connector` and implement the methods requires:

The `refreshTokenExpireIn` method is free for you to implement as per your logic for refreshing the token; See the example below:

Set `setClientId`, `setClientSecret`, `setRedirectUri` change the settings:

```
final class Meli extends MeliConnector
{

    public ?int $tries = 2; // default 1, try to request api 2 times if fail

    public function resolveBaseUrl(): string
    {
        return 'https://api.mercadolibre.com';
    }

    protected function defaultOauthConfig(): OAuthConfig
    {
        return OAuthConfig::make()
            ->setClientId('3232321')
            ->setClientSecret('fs4343fs423')
            ->setAuthorizeEndpoint('https://auth.mercadolivre.com.br/authorization')
            ->setRedirectUri('http://my-site.com/callback.php')
            ->setTokenEndpoint('oauth/token');
    }

    protected function refreshTokenExpireIn(): void
    {
        if ($this->hasExpired()) {
            $refresh = $this->refreshAccessToken($this->refresh_token);

            $this->access_token = $refresh->getAccessToken();
            $this->refresh_token = $refresh->getRefreshToken();
            $this->expires_in = $refresh->getExpiresAt()->getTimestamp();
        }
    }
}
```

Example of use `Meli::make()` or `new Meli()`:

```
$response = Meli::make('access_token', 'refresh_token', 'expire_in')->auth()->request()->order(123456789);
```

Example to generate authentication url in Mercado Livre:

```
 Meli::make()->getAuthorizationUrl();
```

Example to get `access_token` after authentication in Mercado Livre:

```
 $authenticator = Meli::make()->getAccessToken($_GET['code']);

var_dump($authenticator->getAccessToken(), $authenticator->getRefreshToken(), $authenticator->getExpiresAt()->getTimestamp());
```

Tests
-----

[](#tests)

```
./vendor/bin/pest

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~16 days

Total

8

Last Release

930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f31a2c959146aff60a618e292abad2b41ab6a8ee1386225017eb4b6486a61db2?d=identicon)[wandesnet](/maintainers/wandesnet)

---

Top Contributors

[![wandesnet](https://avatars.githubusercontent.com/u/6696213?v=4)](https://github.com/wandesnet "wandesnet (26 commits)")

---

Tags

phpMercado livreMercado livre APISDK Mercado LivreMercado Livre SDKMercado Livre PHPMercado Livre PHP SDKMercado Livre SDK PHP

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wandesnet-mercado-livre/health.svg)

```
[![Health](https://phpackages.com/badges/wandesnet-mercado-livre/health.svg)](https://phpackages.com/packages/wandesnet-mercado-livre)
```

###  Alternatives

[sandorian/moneybird-api-php

Moneybird API client for PHP

127.3k](/packages/sandorian-moneybird-api-php)[marceloeatworld/falai-php

Professional PHP client for the fal.ai serverless AI platform

105.5k](/packages/marceloeatworld-falai-php)[benbjurstrom/cloudflare-images-php

A PHP client for the Cloudflare Images API

1414.6k1](/packages/benbjurstrom-cloudflare-images-php)[okolaa/termiiphp

Termii Rest API php library

112.4k](/packages/okolaa-termiiphp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
