Getting Started

Before you start

Our API is RESTful, which means that every url provides information on different business entities. Each of the these entities is called resource.

All responses are JSON encoded. (For further information on API design go to the Design Considerations section).

Some resources are public and others contain private information. To access to public information you can simply use the following URL:

$ curl https://api.mercadolibre.com/sites/MLA/search?q=ipod

In case you need to access to private resources, an access token will be required:

$ curl https://api.mercadolibre.com/users/me?access_token=...

Creating your own Application

To create an App, you will need to have a valid and active user in one of the countries of our platform. Go to App manager and follow the steps for creating a new application. If you already have a user, you just have to log in, otherwise, you will be guided through the registration process.

After creating the App, you will be given an App ID and a client’s secret key, which will be useful later on. You can read more about how to use this tool on the application manager guide.

application-detail

Authorizing an Application

Applications can only access to private resources if users explicitly grant authorization to the Application.

authentication

authorization

Retrieving your User Information

Our SDKs will enable you to get your user profile using your own application.

Initialize the API with your client_id as follows:

MELI.init({client_id: 6092});

Simple as that. Afterwards, the following line of code will show the first name you register in MELI:

MELI.login(function() {
  MELI.get(
    "/users/me",{},
      function(data) { alert("Hello "+data[2].first_name) }
  );
});
Initialize the SDK with your __client_id__ as follows:

// Try to put this code at the top
require '../src/meli.php';

// Create our Application instance (replace this with your appId and secret).
$meli = new Meli(array(
    'appId'         => 6092,
    'secret'        => "54dfgdgwgw8gfAdgDJDIULkdjhgp87",
));
Meli m = new Meli(6092, "9ykscjsghdPBNQ2SrLqdapp5HbSasswd");

m.authorize("the received code", "http://somecallbackurl");

FluentStringsMap params = new FluentStringsMap();
params.add("access_token", m.getAccessToken());
Response response = m.get("/users/me", params);

Give your App a try!

Enter the application ID you have just created:

User Information

JSON Response
{}

Next Steps

In the Authentication section you will find information about how the application created handles access to private resources. Our Developer Tools will help you to understand how to work with our API.

Afterwards, you should look over our Documentation section to get the solution that best suits your goals and resources:

Please, rate this article