Pinboard API DRAFT Documentation (v2)
GET /hello/
No-op. Useful for checking that credentials are OK and the API is reachable.
This API call is not rate-limited.
> curl 'https://api.pinboard.in/v2/hello?auth_token=user:123'
{ status: 'ok' }
POST /auth/
Given a username and password, returns the auth token for the user. This is the only API call that accepts password authentication.
API clients MUST NOT store user passwords. Instead, use this call to get the user's auth token and store that.
This API call is not rate-limited.
> curl 'https://api.pinboard.in/v2/hello?auth_token=user:123'
{ status: 'ok' }
GET /last_update/
Returns the timestamp of the last stateful change to a user's bookmarks. Does not apply to tab sets, subscriptions, or other account settings.
> curl 'https://api.pinboard.in/v2/last_update?auth_token=user:123'
{ status: 'ok' }
GET /delta/
Retrieve a list of changes since a given timestamp.
This call is intended as a lightweight way to poll the site to update third-party clients.
The call will return three (possibly empty) lists of bookmark IDs. If there have
been too many changes, it may not be possible to get a changeset. The request
will then return a too many changes
error and the client should re-sync the account.
argument | type | comment |
---|---|---|
since | datetime | UTC datetime |
too many changes | Too many items to return, do a full update |
invalid timestamp | Timestamp in future or unreadable |
curl 'https://api.pinboard.in/v2/bookmarks/delta/?since=1366858381&auth_token=user:123'
HTTP/1.1 200 OK
{
status: 'ok',
delta: {
"since" : ['2020-01-02 09:00Z'],
"added" : ['c3b24343f1', '1b50e2c976', 'f8a0a8743e'],
"deleted" : ['7894bb7e44'],
"modified" : ['71b6439f4d', 'bf74aadc31']
}
}
Bookmarks
POST or PUT /bookmarks/
Creates a new bookmark.
argument | type | comment |
---|---|---|
url | url | URL of the new bookmark |
title | title | title |
description | string | description |
tags | tag | comma-delimited list of tags |
private | boolean | privacy flag. Automatically set to TRUE if user has PRIVACY_LOCK |
toread | boolean | sets toread status |
exact_url | boolean | don't normalize URL |
bookmark_exists | A bookmark already exists with this URL. Headers will redirect appropriately |
url_not_valid | URL did not validate |
url_missing | You did not provide a URL |
curl -d "url=http://example.com" "https://api.pinboard.in/v2/bookmarks/"
HTTP/1.1 201 Created
Location: https://api.pinboard.in/v2/bookmarks/b:3a24b2222a21152c/
ETag: "c180de84f991g8"
{
status: "ok",
site_url: "https://pinboard.in/u:user/b:3a24b2222a21152c/"
}
GET /bookmarks/
Retrieves bookmarks in reverse chronological order. This is an expensive query, so please use it only when /delta/ isn't an option.
Query string arguments:
argument | type | comment |
---|---|---|
from | datetime | start date |
to | datetime | end date |
tags | tag | Filter results by up to three tags (tag intersection) |
filter | string | Allowed values are: public, private, toread, untagged, starred . |
count | integer | Number of bookmarks to return. Default is 25, max is 1000 |
offset | integer | Starting offset. Default is 0 |
curl https://api.pinboard.in/v2/bookmarks/unread/?auth_token=user:123&count=20
HTTP/1.1 200 OK
ETag: 036fb010feb019fe
Last-Modified: Wed, 15 Apr 2011 12:41:21 GMT
{ status: "true",
bookmarks : [
{ id : "bd341828e847",
url : "http://example.org/123/",
title : "The beast is back",
desc: "Fear of bees"
tags : ["beer", "wine", "art" ],
created : "2012-03-02T12:34:11Z",
updated : "2013-01-14T19:21:20Z",
private : "1"
}]
}
GET /bookmarks/id/
Retrieve a specific bookmark.
curl 'https://api.pinboard.in/v2/bookmarks/b:a21b6ebd8d12/?auth_token=user:123'
HTTP/1.1 200 OK
ETag: 036fb010feb019fe
Last-Modified: Wed, 15 Apr 2011 12:41:21 GMT
{
status: "ok",
bookmarks : [
{ id : 'bd341828e847',
url : "http://example.org/cakes/",
title : "Cake Recipe",
desc: "My grandma's favorite"
tags : ["cake", "food" ],
created : '2012-03-02T12:34:11Z',
updated : '2012-03-02T12:34:11Z',
private : 1
}]
}
}
POST /bookmarks/id
/Update an existing bookmark.
argument | type | comment |
---|---|---|
id | hex | bookmark ID |
url | url | URL of the bookmark |
created | datetime | creation date |
title | title | title (up to 255 chars) |
tags | tag | comma-delimited list of tags. Empty value will clear tags; leave undefined if you want to keep existing tags |
description | string | Bookmark description |
private | boolean | sets or unsets the privacy attribute. Ignored if PRIVACY LOCK is on |
unread | boolean | sets or unsets the read later attribute |
bad_url | URL was not valid |
404 Not Found | Not found |
bad_id | bad identifier |
missing_id | no identifier |
curl --data-urlencode 'title=A New Title' --data-urlencode='url=http://example.org/'
HTTP/1.1 200 OK
{
status: "ok"
}
DELETE /bookmarks/id/
Permanently delete a bookmark.
curl -X DELETE 'https://api.pinboard.in/v2/bookmarks/b:a21b6ebd8d12/'
HTTP/1.1 202 Accepted
{
status: "ok"
}
GET /bookmarks/id/archived
Returns the URL and crawl metadata to a cached copy of the bookmark content. Available only to archival users.
curl -X DELETE 'https://api.pinboard.in/v2/bookmarks/b:a21b6ebd8d12/archived'
HTTP/1.1 202 Accepted
{
url: "https://cache9.pinboard.in....."
}
POST /bookmarks/id/archived
Requests that an archived bookmark get crawled again. This will overwrite the original copy.
DELETE /bookmarks/
Delete multiple bookmarks. To avoid painful mistakes, it's not possible to delete all bookmarks via the API.
argument | type | comment |
---|---|---|
ids | hex | list of up to 100 bookmark IDs |
curl -X DELETE --data 'ids=518f9a067606+95b74fa4b450+c3098165a314' \
'https://api.pinboard.in/v2/bookmarks/many/'
HTTP/1.1 202 Accepted
{
status: "ok"
}
Tags
Tags are free-form identifiers attached to a bookmark. A tag may not contain whitespace. Tags are not case-sensitive, but Pinboard tries to remember and display them with the original capitalization.
GET /tags/
Returns a full list of the user's tags along with the number of times they were used.
curl "https://api.pinboard.in/v2/tags/?auth_token=user:123"
HTTP/1.1 200 OK
{
status: 'ok',
tags : { 'activedesktop' : 1,
'business' : 12,
'radio' : 3,
'xml' : 4,
'xp' : 4,
'xpi' : 13 }
}
POST /tags/rename/
Renames a tag. Note that this won't work if you're trying to change the case on a tag.
argument | type | comment |
---|---|---|
old | tag | comma-delimited list of up to 3 tags. Note: match is not case sensitive |
new | tag | tag to rename to. If empty, nothing will happen |
curl --data-urlencode "old=polsci pol" \
--data-urlencode "new=politics" \
"https://api.pinboard.in/v2/tags/rename/?auth_token=user:123"
HTTP/1.1 202 Accepted
{
status: 'ok'
}
DELETE /tags/tag
Deletes all instances of this tag.
curl -X DELETE "https://api.pinboard.in/v2/tags/t:food/?auth_token=user:123"
HTTP/1.1 202 Accepted
{
status: 'ok'
}
DELETE /tags/
Deletes multiple tags.
argument | type | comment |
---|---|---|
tags | tag | comma-delimited list of up to 10 tags to delete |
curl -X DELETE --data-urlencode "tags=finance economics money" \
"https://api.pinboard.in/v2/tags/multiple/?auth_token=user:123"
HTTP/1.1 202 Accepted
{
status: 'ok'
}
Network
A user's network is a list of other users they follow.
GET /network/people/
Retrieves a list of people in the user’s network
curl "https://api.pinboard.in/v2/network/people/?auth_token=user:123"
HTTP/1.1 200 OK
{
status: "ok",
people: ["alice", "bob", "fred", "pat"]
}
PUT or POST /network/people/username/
Adds a user to the network.
curl -X PUT "https://api.pinboard.in/v2/network/people/u:jdoe/?auth_token=user:123"
HTTP/1.1 200 OK
{
status: "ok"
}
DELETE /network/people/username/
Removes a user from the network
curl -X DELETE "https://api.pinboard.in/v2/network/people/u:jdoe/?auth_token=user:123"
HTTP/1.1 202 Accepted
{
status: "ok"
}
GET /network/bookmarks/
Fetches bookmarks in the user's network
argument | type | comment |
---|---|---|
count | integer | number of results to return. Default is 25, max is 100 |
before | datetime | return results before this date |
filter | boolean | filter out mechanically-added bookmarks |
curl "https://api.pinboard.in/v2/network/bookmarks/?auth_token=user:123"
HTTP/1.1 200 OK
{
status: 'ok',
bookmarks : [
{
id : 'f82e20805e8ed721',
url : 'http://example.com/pizza/32',
author : 'fred',
title : "Salmon pizza recipe",
tags : ['food', 'cooking'],
created : '2013-05-02T12:34:11Z'
},
{
id : 'dfdf43ddf065c39f',
url : 'http://example.org/wines/',
author : "jane",
title : "Best pinot noir",
tags : ["wine"],
created : '2013-05-02T12:34:11Z'
}
]
}
Notes
A note is a small document with a body, title, and URL. Users can decide if notes should be displayed using markdown. A note can be public or private.
GET /notes/
Returns a list of the user's notes in reverse chronological order.
curl "https://api.pinboard.in/v2/notes/?auth_token=user:123"
HTTP/1.1 200 OK
{
status : 'ok',
notes : [
{
'id' : '2e75e5494ee79e68',
'title' : "Grandma's Potato Recipe",
'created' : '2012-11-30T13:24:22Z',
'updated' : '2012-11-30T13:24:22Z',
'length' : "492",
"api_url" : "https://api.pinboard.in/v2/notes/note:2e75e5494ee79e68".
"site_url" : "https://notes.pinboard.in/u:user/note:2e75e5494ee79e68"
},
{ 'id' : '1182c38f3b387ada',
'title' : "Grandpa's Potato Recipe",
'created' : '2013-10-10T09:17:58Z'
'updated' : '2013-10-13T21:55:02Z',
'length' : "212"
"api_url" : "https://api.pinboard.in/v2/notes/note:2e75e5494ee79e68"
"site_url" : "https://notes.pinboard.in/u:user/2e75e5494ee79e68/"
}
]
}}
GET /notes/id/
Retrieves a specific note.
curl "https://api.pinboard.in/v2/notes/note:2e75e5494ee79e68/?auth_token=user:123"
HTTP/1.1 200 OK
Etag: 2e75e5494ee79e68
Last-Modified: xxx
{
status : 'ok',
'id' : '85e177fc00',
'title' : "Grandma's Potato Recipe",
'created' : '2012-11-30T13:24:22Z',
'updated' : '2012-11-30T13:24:22Z',
"note" : "Cut a potato in half, salt it, eat it"
}
POST /notes/id/
Updates a note. Empty arguments will overwrite data with blanks; leave them unspecified if you want to keep what is there.
argument | type | comment |
---|---|---|
note | string | note content |
title | string | note title |
use_markdown | boolean | format this note using Markdown |
curl --data-urlencode "title=Best Potato Recipe" \
--data-urlencode "note=Cut a potato in quarters" \
"https://api.pinboard.in/v2/notes/note:2e75e5494ee79e68/?auth_token=user:123"
HTTP/1.1 200 OK
{
status : 'ok'
}
POST or PUT /notes/
Creates a new note and returns the identifier.
argument | type | comment |
---|---|---|
note | string | note content |
title | string | note title |
use_markdown | boolean | format this note using Markdown (default false) |
curl --data-urlencode "title=New Potato Recipe" \
--data-urlencode "note=Cut a potato in thirds" \
"https://api.pinboard.in/v2/notes/?auth_token=user:123"
HTTP/1.1 201 Created
Location: https://api.pinboard.in/v2/notes/note:8b07fddb3ad5cf517b82/
{
status : 'ok',
id : '8b07fddb3ad5cf517b82',
api_url : "https://api.pinboard.in/v2/notes/note:8b07fddb3ad5cf517b82/",
site_url : "https://notes.pinboard.in/u:user/8b07fddb3ad5cf517b82/"
}
DELETE /notes/id/
Deletes a note.
curl -X DELETE "https://api.pinboard.in/v2/notes/note:2a8a2ec9f3a076a1/?auth_token=user:123"
HTTP/1.1 202 Accepted
{
status : 'ok'
}
Bundles
Bundles in Pinboard parlance are tag unions. They consist of a name, ID, and a list of tags.
GET /bundles/
Returns a list of the user's tag bundles along with the number of tags in each.
curl "https://api.pinboard.in/v2/bundles/?auth_token=user:123"
HTTP/1.1 200 OK
{
status : 'ok',
bundles : { 'activedesktop' : 1,
'business' : 12,
'radio' : 3,
"xml" : 4,
"xp" : 4,
"xpi" : 13 }
}
PUT or POST /bundles/
Create a new tag bundle. Redirects to an existing bundle if the name is already in use.
argument | type | comment |
---|---|---|
name | string | bundle name |
tags | tag | list of tags |
GET /bundles/name/
Retrieve a list of tags in the bundle.
PUT or POST /bundles/name/
Adds one or more tags to the bundle
argument | type | comment |
---|---|---|
tags | tag | list of tags |
> curl --data 'tags=soul+rhythm%26blues \
'https://api.pinboard.in/v2/bundles/bundle:music/?auth_token=user:123'
{
status : 'ok',
tags : [ 'rock', 'pop', 'disco', 'flamenco']
}
DELETE /bundles/name/
Delete the tag bundle.
> curl -X DELETE 'https://api.pinboard.in/v2/bundles/bundle:music/?auth_token=user:123'
{
status : 'ok',
tags : [ 'rock', 'pop', 'disco', 'flamenco']
}
DELETE /bundles/name//{tag}/
Remove this tag from the bundle.
User
The user object contains information about the user's account status, total bookmark counts, and capabilities (like archiving).
GET /user/
Retrieves information about a user, including account creation date, type (regular or archival), account status.
> curl 'https://api.pinboard.in/v2/user/?auth_token=user:123'
{
status : 'ok',
user : {
account_type: "subscription",
last_active : "2021-01-03 08:45Z",
valid_until : "2022-12-01 12:32Z",
"has_archiving" : "true",
"joined" : "2012-01-13",
"bookmark_counts" : {
"public" : 2020,
"private" : 323,
"unread" : 23
}
}}
}
GET /user/settings/
Fetches a list of the user's current settings.
> curl 'https://api.pinboard.in/v2/user/settings/?auth_token=user:123'
{ status : 'ok',
settings :
{ absolute_dates : '1',
alphabetize_tags : '1',
bookmark_by_email : '1',
click_means_read : '1',
default_private : '1',
disable_history : '1',
fandom_flag : '1',
keyboard_shortcuts : '1',
new_window : '1',
privacy_lock : '1',
public_network : '1',
public_profile : '1',
public_subscriptions : '1',
public_tag_subs : '1',
show_urls : '1',
tag_bundles : '1',
tag_mode : '1',
tag_subscriptions : '1',
user_time_zone : 'America/Los Angeles',
}
}
GET /user/tokens/
Fetch a list of the user's secret tokens.
{
status : 'ok',
tokens : { 'rss_secret' : '2c2621c956',
'email_secret' : '67765' }
}
Tab Sets
GET /tabs/
Retrieve a list of saved tab sets.
> curl 'https://api.pinboard.in/v2/user/tabs/?auth_token=user:123'
{
status : 'ok',
tab_sets : [ { 'id' : '2849d534e5',
'title' : 'Active Desktop',
'created' : '2011-03-21:T00:32:21Z',
'windows' : 4,
'tabs' : 21 },
...
]}
}
GET /tabs/id:{id}/
Get a list of windows and tabs in the saved tab set.
Search
GET /search/user/
Searches within the user's bookmarks.
argument | type | comment |
---|---|---|
query | string | query string for the search engine |
count | integer | number of results to return. Default is 25, max is 100 |
fulltext | boolean | include fulltext results (archival users only) |
offset | integer | offset. Default is 0, maximum 1000 |
GET /search/network/
Searches within the user's network.
argument | type | comment |
---|---|---|
query | string | query string for the search engine |
count | integer | number of results to return. Default is 25, max is 100 |
offset | integer | offset. Default is 0, maximum 1000 |
GET /search/site/
Searches sitewide, with optional tag filters.
argument | type | comment |
---|---|---|
query | string | query string for the search engine |
count | integer | number of results to return. Default is 25, max is 100 |
offset | integer | offset. Default is 0, maximum 1000 |
tag | tag | comma delimited list of up to 3 tags |
Site
GET /site/popular/
Searches sitewide, with optional tag filters.
argument | type | comment |
---|---|---|
filter | string | optional string may be one of 'fandom', 'wikipedia', 'twitter' |
count | integer | number of results to return. Default is 25, max is 100 |
date | datetime | optional day to return results from. Defaults to current day |
tag | tag | comma delimited list of up to 3 tags. Cannot be used with date argument |
POST /awesome/
Use this call to express approbation of Pinboard. Will return a struct with 'thank you'.
This API call is not rate-limited.
> curl -X POST 'https://api.pinboard.in/v2/awesome/?auth_token=user:123'
{ status : "thank you!" }