Hatena::Grouphatenadeveloper

Hatena Star Entry API

en/star/apis/entry

Hatena Star Entry API

Overview

The Hatena Star Entry API provides access to the list of the stars added to specified URLs by HTTP GET requests.

Authentication

The API does not require authentication. Current version of the API only provides access to stars added to public URLs.

Retrieval of stars (/entry.json)

The list of the stars added to URLs can be retrieved by accessing the following URL using HTTP GET method:

http://s.hatena.com/entry.json

Parameters in HTTP requests

The following parameter can be included in HTTP requests in the application/x-www-form-urlencoded format:

Parameter nameParameter value#
uriEntry URLs (scheme must be http or https)0+

A URL must be a canonicalized absolute URL; i.e. the result of parsing and then serializing the URL can't be different from the original URL.

HTTP response

If the retrieval has not failed, a success response such as 200 (OK) is returned. The HTTP response body is a JSON object with following properties:

  • entries An array of zero or more following objects:
    • uri A URL
    • stars An array of zero or more following objects, representing yellow stars for the URL:
      • name Hatena ID of the user of the star
      • quote Quotation of the star (or empty string)
      • count Number of the stars (can be omitted if 1)
    • colored_stars An array of zero or more following objects (omitted if there is no color star):
      • color Color of the star (green, red, blue, and so on)
      • stars An array of the objects representing color stars, in the same format as yellow stars

If the retrieval has failed, 400 (Bad Request), 401 (Authorization Required), or similar HTTP response, or 200 (OK) response with JSON data containing error messages, is returned.

Example

GET /entry.json?uri=http%3A%2F%2Fwww.example.com%2F&uri=http%3A%2F%2Fwww.example.com%2Fnotfound&uri=http%3A%2F%2Fwww.example.net%2F HTTP/1.1
Host: s.hatena.com
User-Agent: ExampleUserAgent/1.0

HTTP/1.1 200 OK
Content-Type: application/json

{
  "entries": [
    {
      "uri": "http://www.example.com/",
      "stars": [
        {
          "name": "sample",
          "quote": ""
        },
        {
          "name": "sample",
          "quote": ""
        }
      ],
      "colored_stars": [
        {
          "color": "purple",
          "stars": [
            {
              "name": "hatenastar",
              "quote": "Hello",
              "count": 2
            }
          ]
        }
      ]
    }
    {
      "uri": "http://www.example.net/",
      "stars": [
        {
          "name": "hatenahaiku",
          "quote": ""
        }
      ]
    }
  ]
}

History

  • April 11, 2013 Published.