mercadolibre / python-sdk Goto Github PK
View Code? Open in Web Editor NEWMercadoLibre's Python SDK
MercadoLibre's Python SDK
When i try to run the example of the authorization code it redirect me into a login page like this one:
https://www.mercadolibre.com/jms/mla/lgz/login/?go=https%3A%2F%2Fauth.mercadolibre.com.ar%2Fauthorization%3Fclient_id%3D479%26redirect_uri%3Durl.com.ar%26response_type%3Dcode&platform_id=ml&application_id=479939650732
This one contains fake parameters, but is where https://auth.mercadolibre.com.ar/authorization requesting this url leads me.
Is there a way to make that login with a request?
For the moment i solved it using Selenium, but i think is no the best way.
Hi!,
I think the code should be more compatible with Python3 these days, since Python2 "only" is getting old...
Also seems this SDK is the "less maintained" than all others SDK offered by ML...
Hi,
I have an issue related with redirect uri. currently i am trying to integrate my application which is running on my local with url 'http://localhost:8069' .
Error: i am getting RedirectURI is not define.
Can you please provide some suggesation on how can i define the redirect URI while calling the auhorize function of mercadolibre. and application i already created on mercadolibre.
Thanks
Hi !
I have a problem when i try:
resource=orders/search/recent?seller=$SELLER_ID
this:
https://api.mercadolibre.com/orders/search/recent?seller=$SELLER_ID&access_token=$ACCESS_TOKEN
became this:
https://api.mercadolibre.com/orders%2Fsearch%2Frecent%3Fseller%3D$SELLER_ID
and throw error 400 (backslash problem)
SOLVED editing in file: rest.py
url=url.replace("%2F",'/')
url=url.replace("%3F",'?')
url=url.replace("%3D",'=')
saludos
Since this API SDK is using requests, I think would be better to post files as requests way: http://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file
Using this method, requests will send a multipart/form-data.
EDIT: temporary I had to create a own method by using pycurl (which works), since using requests (from this API) and param files (added to the post method), the response status is 500.
The code for pycurl: https://stackoverflow.com/a/53547438/6696269
I made a adapitação to python3 , feel free to incorporate the user of you .
Hello,
I am really lost regarding how to use Meli's API with my DRF API. Could you kindly guide me towards a direction?
Thank you very much.
curl -X GET -H https://api.mercadolibre.com/items/MLM879866511/?attributes=sold_quantity,start_time
{
"sold_quantity": 500,
"start_time": "2021-02-26T04:17:49.000Z"
}
The oauth service returns:
{"access_token":"APP_USR-35766...90-102411-54bb20457...c10b5a230138dec__D_A__-108758138",
"token_type":"bearer",
"expires_in":10800,
"scope":"offline_access read write",
"refresh_token":"TG-5269...b0a34eb0ddf3a9"}
The access_token
has an expiration (10800), at least during that time it shouldn't be necessary to send a new POST to the oauth service and get the token again. Implementing this will lower the load of MELI's oauth service and make the python-sdk faster to use since for most actions it's sending 2 HTTP requests (oauth+real action) and if the expiration is taken into account only 1 HTTP request will be sent in most cases.
Bom dia,
Ativei o envio de notificações para a minha aplicação.
No começo estava recebendo timeout quando consultava o feed e não recebia os POST´s das notificações.
Depois de um dia ou dois passei a receber OK os POST´s, porém com reqtime elevado, cerca de 2~3s mesmo que eu estivesse tratando e enviando 200 imediatamente.
Agora voltou a dar timeout.
Alguém já passou por isto?
Minha aplicação está rodando no raspberry pi na empresa, utilizando dns do google domains na rede da Vivo.
Subi um serviço da Clouflare chamado Workers, e redirecionei as notificações para lá apenas para testar se desta vez funciona ok.
Obrigado.
hello guys, i need some help, can i use this API without a website? i wanned to make an local app with pyqt5, and connect to the API, can i do that?
im trying to get a test, but it reutns an error, my request is fine, but its not returning a test user.
We were working on an ecommerce project some time ago and this python-sdk wasn't so good, so we created a new sdk, in case someone finds it useful: https://github.com/santiagobasulto/mercadolibre.py
I tried to create new application on the website https://global-selling.mercadolibre.com/devcenter/create-app, but it does not work at all. When I filled in form and click "Create" button, the alert showed"some problems occur……", and the browser console showed that " xhr.js:172 POST https://global-selling.mercadolibre.com/api/apps/ 400 "
Does any official staff can help me?
Thanks in advance
Hi, tried to open a new ticket at support.
But receive the message that is only for partners now.
It´s true? How can I became partner?
I would like to ask about GET on myfeeds, I´m receiving [] at return.
hello guys!
as the doc says, i have do post file to https://api.mercadolibre.com/v1/claims/{claim_id}/attachments, I did the same with the messages(not claim messages) and it worked, but with claim attachments even making a post, the api returns this message: "cannot get attachment".
Traceback (most recent call last):
File "teste.py", line 3, in
from meli import Meli
ImportError: No module named meli
As I can see, the code has changed absolutely and no notice even in readme.md so now many old issues will die in the air.
What is going on with you guys at Mercado Libre? That bad is the developers team organization and you don't event know how software development steps must be?
I just notice this and that now (for better) is a python package. You should be more informative about this big change (I don't event know when this happened. Just browsing this repos is there was any changes, just by chance).
Put your house in order ML...
With the implementation of the shopping cart coming soon, we need to pass the extra header x-format-new: true
to be able to parse the new orders JSON. However, there doesn't seem to be a way to do this at the moment of writing this.
When resource_get for currency_conversion, classified_locations and other modules:
def get_local_currency_by_country_id( country_id ):
query = "/classified_locations/countries/{}".format( country_id )
try:
response = api_instance.resource_get(query, CLIENT_SECRET)
return json.dumps( response )
except ApiException as e:
pass
return None
I get the following error message:
{"message":"{\"message\":\"Malformed access_token: MY-SECRET-TOKEN TEST\",\"error\":\"bad_request\",\"status\":400,\"cause\":[]}","error":"","status":400,"cause":[]}
How do I pass the "content-type" and "file" parameters using the .resource_post method?
As in :
curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' \
-H 'content-type: multipart/form-data' \
-F 'file=@FILE' \
https://api.mercadolibre.com/pictures/items/upload
python-sdk/examples/get_token.py
Line 25 in 04a2ee0
I think the try-except clause is put accidentally outside of the context managed part. The same happens in other examples.
Hi,
I tried to call authorize function for generating the token founding the error below.
Can you please help me on it.
Thanks
Arpit
meli.authorize('TG-5a58c14fe4b0ff39be25d772-295295916', redirect_URI="https://bb6b4a5f.ngrok.io")
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-x86_64/egg/melipy/core.py", line 49, in inner
File "build/bdist.linux-x86_64/egg/melipy/core.py", line 89, in authorize
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.mercadolibre.com/oauth/token?code=TG-5a58c14fe4b0ff39be25d772-295295916&client_secret=Fn9k3FXuyPw921whwdtXJDAbGp2Ax4t9&grant_type=authorization_code&client_id=5961429306344932&redirect_uri=https%3A%2F%2Fbb6b4a5f.ngrok.io
Hi everyone
I would like to know if there is a way to consult the API and obtain for example a property search, or some sports article. I would also like to get sales and visits. I use anaconda and Jupyternotebook, python 3. Can anyone help me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.