Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the findItemsAdvanced tool of eBay API and get more than 100 entries? #372

Open
MageScript opened this issue Jul 27, 2022 · 0 comments

Comments

@MageScript
Copy link

I know that with eBay's API we can't make a call that provides more than 100 entries. That's why i tryed to make several calls with different "pageNumber" in order to get 100 entries multiplied by the number of page i decided to choose.

But at the second call (the call with pageNumber=2), i have the following exception error :

for item in response.reply.searchResult.item: AttributeError: 'ResponseDataObject' object has no attribute 'item'

Please, do you know how to solve it ?

Here is my code :

from ebaysdk.finding import Connection as Finding

api = Finding(appid="XXX", config_file=None, siteid="EBAY-FR")

keywords=str(input("What keywords do you want to use ? : "))

for page in range(1,5):

    request={
            "keywords": keywords,
            "paginationInput": 
                {
                    "entriesPerPage": 100,
                    "pageNumber": page
                }
            }

    response = api.execute('findItemsAdvanced', request)

    paginationOutput = response.reply.paginationOutput
    print(paginationOutput)

    for item in response.reply.searchResult.item:
        try:
            title=item.title
            price=float(item.sellingStatus.convertedCurrentPrice.value)
            listingType = item.listingInfo.listingType
            url=item.viewItemURL
                
            if price>0 and price<400 and listingType=="FixedPrice":
                print("title : ", title)
                print("price : ", price)
                print("url : ", url, "\n")

        except:
            pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant