Skip to content

API codepoint

Manuel Strehl edited this page Nov 13, 2013 · 6 revisions

Request one Codepoint

Template for this request:

http://codepoints.net/api/v1/codepoint/{codepoint}{?property*}{?callback}

where {codepoint} is a hexadecimal number and {property} is either no GET parameters at all (for full information) or a list of codepoint properties to return:

?property=na,age,gc

This request will return a JSON object with three fields:

{
    "na": "The Unicode name",
    "age": "when the codepoint was added to Unicode",
    "gc": "the general category of this codepoint"
}

{?callback} is an optional callback function name to perform a JSON-P request.

Response

The response is a JSON object with property names as keys and properties of the codepoint as values.

Additional HTTP Headers

A successful response will contain three to four Link headers:

  1. rel=alternate links to the description page of the codepoint on the main site.
  2. rel=up links to the API endpoint for the containing Unicode block.
  3. rel=prev links to the previous codepoint, if it exists.
  4. rel=next links to the next codepoint, if it exists.

Possible Errors

  1. 400 Bad Request: If the value for {codepoint} is not a valid hexadecimal number.
  2. 404 Not Found: If the value for {codepoint} is no recognized codepoint (but a valid hexadecimal number).
Clone this wiki locally