allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
217 stars 39 forks source link

Products listing #3276

Closed achchu93 closed 4 years ago

achchu93 commented 4 years ago

Hello there,

I wanna know that can i fetch products with just filters or by any category without phrase or EAN? For an example as per the attachaed link below, it filters and shows products with EAN or phrase. Like that can i achieve it via REST api? I tried it, but i get response as required field missing. Please help me.

FILTERED: https://allegro.pl/kategoria/blotniki-listwy-nakladki-254685?price_from=200&amp%3Bprice_to=550&amp%3Bstan=nowe&amp%3Bvat_invoice=1&amp%3Bdostawa-kurier=1&amp%3Border=qd&amp%3Bbmatch=baseline-product-cl-eyesa2-dict43-aut-1-4-0318&bmatch=baseline-al-product-cl-eyesa2-engag-dict45-aut-1-2-0513&stan=nowe&price_to=650&vat_invoice=1

Thanks, Regards!

PrzemyslawLukanowski commented 4 years ago

Yes, you can search through offers via GET offer/listing. Sample requests can be found in our guide. If you will keep getting error - please send us your request, we will verify it.

achchu93 commented 4 years ago

Great, Thanks for the help. But the issue is when i try it via some categories it says resource not available. Then i noticed some of categories works. Can i filter and fetch only categories which have offers?

PrzemyslawLukanowski commented 4 years ago

Could you please send us sample request with this response?

achchu93 commented 4 years ago

I send request to GET /sale/categories. Then i receive an array of categories. But when i send a request to GET /offers/listings with some of categories i dont get offers. For an example Electronics is 5. So when i send GET /offers/listings?catgory.id=5 i dont get offers. When i look for the reason electronics is not leaf category. So what i am trying to achieve is can i get only leaf categories like this GET sale/catrgories?type=leaf. I want to get only leaf categories where offers are being added.

PrzemyslawLukanowski commented 4 years ago

You can search all categories except main categories (root), but there isn't a filter such as e.g. ?type=leaf, you need to provide specific category id.

achchu93 commented 4 years ago

Your reply didnt help me. Anyway thanks. You havent showed us how to search all categories except main categories. Is there any endpoint for that or some filter? And seriously your documentation is not good as expected.

PrzemyslawLukanowski commented 4 years ago

You need to provide a specific category id, there isn't a separate filter or endpoint for this. First, you should retrieve subcategories id via GET /sale/categories?parent.id={parent category id} and then you can use these ids in your requests - GET /offers/listing?category.id={categoryID}.

stale[bot] commented 4 years ago

W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 30 dni. Dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu 7 dni nie pojawi się żadna odpowiedź, zamkniemy ten wątek. Dziękujemy za zaangażowanie w dyskusję.