28
Views
8
Comments
Solved
free market api
Question

Hi everyone, I'm having trouble requesting information from the Mercado Livre API. Could someone help me? I've already done all the configurations, but I need to obtain the first access token and I'm stuck on this part. If anyone has managed to use it before, could you help me?

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

The issue happens because OutSystems sends requests using application/json by default, but Mercado Livre expects the data in application/x-www-form-urlencoded format. To fix this, simply update your request header: Change the header Content-Type: application/json to Content-Type: application/x-www-form-urlencoded After that, ensure the body is formatted accordingly.

2026-01-11 09-41-52
Daniel Cabral

I'll do that and come back here with the answer, okay? Thank you

2026-01-11 09-41-52
Daniel Cabral

I managed to solve the problem of not being able to generate the access token, but now I'm having a problem with the request. When I do the GET request using: https://api.mercadolibre.com/products/search?site_id={site_id}&q={q}&status={status} it only finds products using the MLA site_id, as in the Mercado Libre example. However, when I try to use, for example, MLB, which is from Brazil, it returns empty. What could be the problem? Thank you in advance for your attention.

2026-01-11 09-41-52
Daniel Cabral

 Respondendo ao seu comentário de 24 de fevereiro de 2026 às 22:4Resolvido! Por algum motivo, quando eu usava MLA, ao voltar para MLB, funcionou como mágica. Obrigado pela atenção, amigo.
2018-12-10 12-16-21
Goncalo Duarte Almeida

Great. Glad it's all working.

If it's all ok just mark the solution and close the ticket.

Regards.

Gonçalo Almeida

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

The documentation is quite complete. Where are you stuck?

https://developers.mercadolivre.com.br/pt_br/autenticacao-e-autorizacao


2023-10-16 05-50-48
Shingo Lam

Hi @Daniel Cabral

Can you share more information about the issue? what do you mean by "done all the configurations"?

2026-01-11 09-41-52
Daniel Cabral

I got to the part where I put: https://api.mercadolibre.com/oauth/token in the URL of the POST method, and then I looked at the documentation and saw that I need to change the format I need to send the POST because the MercadoLibre API doesn't accept JSON. I couldn't complete those steps.

2018-12-10 12-16-21
Goncalo Duarte Almeida
Solution

The issue happens because OutSystems sends requests using application/json by default, but Mercado Livre expects the data in application/x-www-form-urlencoded format. To fix this, simply update your request header: Change the header Content-Type: application/json to Content-Type: application/x-www-form-urlencoded After that, ensure the body is formatted accordingly.

2026-01-11 09-41-52
Daniel Cabral

I'll do that and come back here with the answer, okay? Thank you

2026-01-11 09-41-52
Daniel Cabral

I managed to solve the problem of not being able to generate the access token, but now I'm having a problem with the request. When I do the GET request using: https://api.mercadolibre.com/products/search?site_id={site_id}&q={q}&status={status} it only finds products using the MLA site_id, as in the Mercado Libre example. However, when I try to use, for example, MLB, which is from Brazil, it returns empty. What could be the problem? Thank you in advance for your attention.

2026-01-11 09-41-52
Daniel Cabral

 Respondendo ao seu comentário de 24 de fevereiro de 2026 às 22:4Resolvido! Por algum motivo, quando eu usava MLA, ao voltar para MLB, funcionou como mágica. Obrigado pela atenção, amigo.
2018-12-10 12-16-21
Goncalo Duarte Almeida

Great. Glad it's all working.

If it's all ok just mark the solution and close the ticket.

Regards.

Gonçalo Almeida

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.