You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unsurprisingly, the function “def get_article_category(self, article_id: str)” no longer works.
I have already looked through the entire JSON returned by “/pages/product-details-page-root?id={article_id},” but I haven't found any clues as to a category.
Does anyone have any idea how I can get the category of an article with the current api?
I seem to have forgotten about this function. Requesting a category together with an article's data raises a NotImplementedError so this is just a leftover. This was broken ever since I forked the library and when wanting to fix it, I too couldn't find any endpoint or reference to a category, so I just left it at that.
The function get_category_by_ids has been added and get_article can now be used with the parameter add_category = True to also retrieve the category data. See #20 (comment)
If you have a use-case where returning the Level 1 category could be useful, please open a new issue for that.
Thank you for bringing this up!
Activity
codesalatdev commentedon Sep 6, 2025
I seem to have forgotten about this function. Requesting a category together with an article's data raises a NotImplementedError so this is just a leftover. This was broken ever since I forked the library and when wanting to fix it, I too couldn't find any endpoint or reference to a category, so I just left it at that.
littleyoda commentedon Sep 6, 2025
Small update:
If you add "show_category_action=true" to the article url, the Json-File contains some category information:
path = f"/pages/product-details-page-root?id={article_id}&show_category_action=true"
I tried to a request, without success.
p._get("/categories/19362/l2/19431/l3/19769", add_picnic_headers=True)Unfortunately, I don't have any idea what else I can do with the information at the moment.
littleyoda commentedon Sep 6, 2025
Using the information from p.get_categories(), you can translate at least the first two levels ( 19362 and 19431)
codesalatdev commentedon Sep 6, 2025
That's a big update! :D I will get my PicNic-Phone operational again and see what I can find. Thank you so far!
Translating the first two levels would definitely be a fallback.
codesalatdev commentedon Oct 3, 2025
The function
get_category_by_idshas been added andget_articlecan now be used with the parameteradd_category = Trueto also retrieve the category data. See #20 (comment)If you have a use-case where returning the Level 1 category could be useful, please open a new issue for that.
Thank you for bringing this up!