Hatena Haiku RESTful APIs enable your application to create (post / associate), retrieve, or delete entries, keywords, favorites, stars, and so on, from Hatena Haiku, on behalf of your users. This document describes how to use these API.
We may discontinue or change Hatena Haiku APIs, or its availability to you at any time.
Hatena reserves the right to limit, close, or remove, either temporarily or indefinitely, any user's account when the user exeeds the ordinary use of the service. Applications MUST send their own name in the HTTP User-Agent: header field.
Sometimes in this document we refer to Version 1.1 of Hatena Haiku. Version 1.1 of the service is available at the formal domain (i.e. h.hatena.com and h.hatena.ne.jp) from Feburary 14, 2011, as well as at the beta-testing domain (i.e. h1beta.hatena.com and h1beta.hatena.ne.jp).
Most of read-only APIs can be used without authentication.
The APIs support OAuth-based user authentication. You can obtain Consumer Keys for the OAuth access from the Access Hatena services with OAuth section in your User Settings. There is a tutorial document はてなサービスにおける OAuth (available only in Japanese at the time of writing, but sample codes are also included there).
For read operations, the scope read_public is required; for write/delete operations, the scope write_public is required.
HTTP Basic Authentication is supported by Hatena Haiku but is now DEPRECATED in favor of OAuth.
Please input "Hatena ID" for ID, and "API password" for password (...@h.hatena.com).
ATTENTION: Hatena Haiku API use not Hatena password but "API password" for password.
Hatena Haiku APIs presently supports the following data formats: JSON, JSONP, XML. You can get it by specifying .json, .json?callback=cb, .xml respectively. See detailed documentation and examples for APIs.
A timeline is a list of zero or more entries. Following APIs provide access to various kind of timelines:
| Name | Corresponding page in the Web site |
|---|---|
statuses/public_timeline | Hatena Haiku Top page |
statuses/keyword_timeline | Entries page for a keyword |
statuses/user_timeline | Entries page for a user |
statuses/friends_timeline | Antenna page for a user |
statuses/album | Album page for a keyword or the entire service |
Following APIs can be used to post, retrieve, or delete entries and stars:
| Name | Operation |
|---|---|
statuses/update | Post a new entry |
statuses/show | Retrieve an entry |
statuses/destroy | Delete an entry |
favorites/create | Add a star to the entry |
favorites/destroy | Delete a star from the entry |
Following APIs can be used to retrieve or operates on users and keywords:
| Name | Operation |
|---|---|
friendships/show | Retrieve user's data |
keywords/show | Retrieve keyword's data |
keywords/hot | Retrieve list of hot keywords |
keywords/list | Search for keywords |
keywords/relation/create | Mark two keywords as related |
keywords/relation/destroy | Unmark two related keywords |
Following APIs can be used to retrieve list of favorite users and keywords, and to add or remove favorite users and keywords:
| Name | Operations |
|---|---|
statuses/friends | Retrieve the list of favorite users of a user |
statuses/followers | Retrieve the list of fan (or favorited) users of a user |
friendships/create | Add a user to the favorites |
friendships/destroy | Remove a user from the favorites |
statuses/keywords | Retrieve the list of favorite keywords of a user |
keywords/create | Add a keyword to the favorites |
keywords/destroy | Remove a keyword from the favorites |
Hatena Haiku RESTful APIs are partially compatible with Twitter APIs. Following features are also available in Twitter APIs:
Following APIs are extended for Hatena Haiku specific features such as keywords: