Lancer
Lancer

Reputation: 55

Pocket API: How to get tags list

I found that the Retrieving API has a tag parameter which is used to get items tagged with tag_name. But I do not know how to get the tags list. If the tags list cannot be got, then how to set this parameter to get special items with this tag.

Upvotes: 5

Views: 2020

Answers (3)

Ambrose Leung
Ambrose Leung

Reputation: 4215

I contacted [email protected] and they gave the same answer - no API to just get the tags list.

I forgot to set a detail type, which is why I wasn't getting the tag information on an individual article.

Call https://getpocket.com/v3/get with the 'detailType' POST parameter set to 'complete' (as someone already mentioned earlier in a longer answer)

Then you get the tags back

....
"has_video": "0",
  "has_image": "1",
  "word_count": "513",
  "tags": {
    "entrepreneur": {
      "item_id": "1768258176",
      "tag": "entrepreneur"
    },
    "work": {
      "item_id": "1768258176",
      "tag": "work"
    }
  },
....

Upvotes: 0

StefanDK
StefanDK

Reputation: 173

I have been examining this issue very thoroughly for the past weeks (a request for tag list functionality from a user of my Window 8.1 app Pockazine), and my research confirms that fcedillo is right in saying that the API does not seem to support such a simple request.

However, both the Android app, the iPad app and the webapp (and the mentioned getTags.php) does provide a list of tags which leads me to believe there is a non-official API to get this information. How else would the native Pocket apps be able to get this information - I do not believe it is downloading a full list of all articles.

Even if this functionality is not implemented in the API yet, it really should be a simple database query like "select distinct(tag_name) from ... where user_id = ..." with a webservice layer to wrap it with a few parameters.

I have raised the issue with Pocket and followed up with emails to Pocket for the past few weeks without any luck.

My own workaround is to get all active and archived items with the "detailType" parameter set to "complete" and then iterate over the entire list and collect tags from the tag list in each article.

That is a cumbersome and expensive operations both in terms of time (20 seconds for 6.000 articles downloaded in packages of 2,500), data packages (at least 12 MB for that list of 6.000 articles) and database cpu-time (probably not that much, but still worth mentioning).

Even this is not a satisfactory solution since it seems I can maximum download 6,000 articles (unless I myself have precisely that amount of active and archived articles) - and even if I could it would be a bad idea to e.g. download 100,000 articles just to show maybe 50 tags or so.

So ... If anybody has a different solution (or I get an answer from Pocket) then I would be extremely glad for a followup to this post.

Upvotes: 2

fcedillo
fcedillo

Reputation: 48

I think that Tag list cannot be got using the API

If you just want the list, you can take it from getpocket.com, browse to your list

And look for response to getTags.php request https://www.evernote.com/shard/s187/sh/7d0fb324-379c-466f-a695-fc2184576ad6/5b23f3bb0165d9c7

You will find an array of tags: eg. ["tag1","tag2","tag3"]

Maybe this could be helpful https://github.com/HartasCuerdas/ruPocket

That is an implementation to work with Tags from Pocket, its written in Ruby

Upvotes: 1

Related Questions