cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filter Browse API by lastSoldDate

https://api.ebay.com/buy/browse/v1/item_summary/search?q=phone&limit=3&filter=itemEndDate:%5B2024-02...

 

is throwing me an error using the API test tool - Price is doing the same thing. What am I missing? 

 

"warnings": [
{
"errorId": 12002,
"domain": "API_BROWSE",
"category": "REQUEST",
"message": "The itemEndDate filter value is invalid. For the valid values, refer to the API call documentation.",
"parameters": [
{
"name": "fieldName",
"value": "itemEndDate"
},
{
"name": "filterValue",
"value": "[2024-02-14T00:00:00Z..2024-02-15T23:59:59Z]"
}
]
}
]

Message 1 of 4
latest reply
3 REPLIES 3

Filter Browse API by lastSoldDate

@neospark627 

 

I see "itemEndDate", not "lastSoldDate" in your query. 

 

The Browse API is designed to display active listings to buyers, so only future end dates should be chosen when selecting "itemEndDate". Was one of your end dates in the past? 

 

I would expect different results with "lastSoldDate" in the query, in which case, you would want those dates to be in the past.

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 2 of 4
latest reply

Filter Browse API by lastSoldDate

100% correct I was trying to get of the itemEndDate or lastSoldDate to work and was sloppy with changing the dates. Even with using lastSoldDate and using dates in the past (Yesterday- 30 days.. Yesterday) it still is throwing me an valid values error. 

Message 3 of 4
latest reply

Filter Browse API by lastSoldDate

@neospark627 

 

Notice on this page that  lastSoldDate is only available to Market Insights.  

https://developer.ebay.com/api-docs/buy/static/ref-buy-browse-filters.html 

 

 

Because of your other mixed results, I went through this long exercise as a learning process:

 

Using eBay's API Explorer, in production mode:

https://developer.ebay.com/my/api_test_tool?index=0&env=production 

 

I selected:

  • (0) United States
  • Browse API
  • Search

And selected samples:

  • Basic

I entered this endpoint with tomorrow's dates:

https://api.ebay.com/buy/browse/v1/item_summary/search?q=phone&limit=3&filter=itemEndDate:%5B2024-02-16T00:00:00Z..2024-02-16T23:59:59Z%5D

Then I clicked the "Get OAuth User Token" link over on the right and logged in a real user.

The token appeared on the token box and in the header of the call.

"Execute" was successful and I was shown phones with no warnings.

 

Next, I tried the same scenario, but clicked the "Get OAuth Application Token" instead, since only an application token is needed for "Search". The new token populated the box and the header. I changed the query to "tablet" to ensure I would get a different response.

"Execute" was successful and I was shown tablets with no warnings.

 

lastSoldDate

 

Next, I tried to search ended items (which is something eBay has been taking away from other APIs). 

I chose dates in the past.

https://api.ebay.com/buy/browse/v1/item_summary/search?q=phone&limit=3&filter=lastSoldDate:%5B2024-02-10T00:00:00Z..2024-02-11T23:59:59Z%5D

I was suspecting the intent of the "lastSoldDate" would be to locate multi-quantity items that are popular (sold recently) where more are still available for purchase, since active items were returned.

 

I received the same warning you displayed, and only 2, not 3, active listings were provided:

https://www.ebay.com/itm/334470172936  created: 2022-06-10T12:24:13.000Z

https://www.ebay.com/itm/335019311228    created: 2023-09-06T22:04:55.000Z

So I reduced the limit to 2, but got the same warning and the same two listings.

 

I fiddled with the date codes to include microseconds, like those shown for the creation dates, but no difference. I tried only the start and only the end, but no go. Then I backed up the end date to 2023-08-17 to eliminate the listing created in Sept 2023.  But the tool still returned the same two active listings. Thus, I suspect the sold date is ignored entirely.

 

Additionally, I tried a different query string, which returned single quantity items. Thus the search is not limited to items that have already sold some quantity, so scrap my initial theory about popular sales. 

 

(Because I spent a half day on this, I occasionally encountered a red "something went wrong", and suspected an expired token.  I was unable to refresh the token in that explorer screen, so had to restart the page and request a new token.)

 

Some filters require an additional filter be included in the call.

For instance, "filter=price:[5..10]" fails,

while "filter=price:[5..10],priceCurrency:USD" succeeds.

 

itemStartDate must be in the past and itemEndDate must be in the future.

 

I tried capitalizing the "i" at the beginning, and got the same errors for the above two filters, so the error is not very specific, which leads me to suspect that "lastSoldDate" is not actually a valid filter here, and the warning has nothing to do with any formatting.

 

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 4 of 4
latest reply