Getting Started
If you’re reading this it’s because you’re wondering which is the easiest way to start using our API. Good news! It is dead simple!
Table of Contents
Your first approach to the API
Our API is RESTful, which means that every url provides information on different business entities. We call this resource. The way you can operate on resources is by using HTTP methods (see HTTP Methods).
Some of these basic methods are:
- GET: Retrieve information identified by the resource (see GET).
- POST: Create a new resource (see POST).
- PUT: Change a resource (see PUT).
- DELETE: Delete a resource (see DELETE).
So for example if you curl:
$ curl https://api.mercadolibre.com/countries
You’ll get a list of countries:
[
{
"id": "AR",
"name": "Argentina",
"locale": "es_AR",
"currency_id": "ARS",
},
...
]
And if you want a specific country you can do:
$ curl https://api.mercadolibre.com/countries/BR
In this case you’ll get the information of Brazil.
{
"id": "BR",
"name": "Brasil",
"locale": "pt_BR",
"currency_id": "BRL",
"decimal_separator": ",",
"thousands_separator": ".",
"time_zone": "GMT-03:00",
"geo_information": {...},
"states": [...],
}
Get your access token!
Our API will give you lots of information. Some of it is private, meaning you’ll get access only if you have an access token. For example if you want to get your own information:
$ curl https://api.mercadolibre.com/users/me
You’ll get a 403 Forbidden http status code. This means you need this special access token that will validate that you actually gave the application permissions to access your information. See HTTP Status Codes.
NOTE: Access tokens will be granted to you by the owner of the information you are trying to access. See Authentication & Authorization.
In order to start playing with the API, click the button to get an access token.
token
NOTE: You’ll be granting to this developer site basic access to your information.
Use your access token!
Now that you have an acccess token, the developers site application can access your basic information by requesting /users/me and appending a query string parameter called access_token with the value of the access token:
$ curl https://api.mercadolibre.com/users/me?access_token=...
info
What’s next?
Now you know what are our REST API, and you know how to obtain an access token and use it to access different resources. Probably the next step should be creating your own application or you can also check what can you do with the API.