Export your personal Pocket data, including highlights as JSON.
pip3 install -r requirements.txt
- To use the API you need a
consumer_key. You've got two alternatives here:
Lawful good way: register an app here with 'Retrieve' permissions and type 'Desktop (other)'. Open app in the list and take note of
Chaotic way: get API key directly from web app. The benefit of doing this is that API gives away more data, including highlights.
You can find
consumer_keyin 'Request URL' for any of
This is sort of hacky, but only way I know of extracting highlights. I tried registering apps targeting other platforms (e.g. web/extension), but still nothing, seems that Pocket's consumer key is hardcoded in backend code or something.
- Follow these instructions to retrieve an API token using
consumer_keyyou got on the previous step. You can use anything as
https://example.com. You should get
- It might be convenient to dump these in a file, e.g.
consumer_key = ... access_token = ...
./export --secrets /path/to/secrets.py. That way you have to type less and have control over where you're keeping your plaintext tokens/passwords.
Alternatively, you can pass auth arguments directly, e.g.
./export --consumer_key <key> --access_token <token>.
However, this is prone to leaking your keys in shell history.
You can also import script and call
get_json function directory to get raw json.
I'm not aware of any limits on number of old entries you can retrieve through API; it doesn't even have pagination. If you know of them, please let me know or open PR!
It's highly recommended to back up regularly and keep old versions. Easy way to achieve it is command like this:
./export --secrets secrets.py >"export-$(date -I).json".
See ./example-output.json, it's got some example data you might find in your data export.