pythonebay-sdk

Automatic conversion currency to local one with ebay sdk


I use

response = api.execute('findItemsAdvanced', {'keywords': keyWords,
                                                'paginationInput': {
                                                'pageNumber': pageNumber,
                                            },
                                            'sortOrder': 'PricePlusShippingLowest',
                                            'itemFilter':itemFilter})

Is it possible to make it retrieve price: 1. in local currency 2. in particular currency,

For example the ebay site gives you approximate price.


Solution

  • You can shuffle siteid parameter. But much more robust approach is to create currencies rates on Your own, lets say:

    import numpy as np
    eur_rate=4.3008 #EUR to PLN rate
    usd_rate=3.9047 #USD to PLN rate
    gbp_rate=5.0411 #GBP to PLN rate
    a = np.array([["EUR",eur_rate]], dtype=object)
    b = [["USD", usd_rate]]
    c = [["GBP", gbp_rate]]
    curr_rates = np.vstack((a,np.asarray(b,object)))
    curr_rates = np.vstack((curr_rates,np.asarray(c,object)))
    

    Here is my python repository: https://github.com/Brat-Pit/eBay