-
Notifications
You must be signed in to change notification settings - Fork 11
API codepoint
Manuel Strehl edited this page Nov 13, 2013
·
6 revisions
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.
The response is a JSON object with property names as keys and properties of the codepoint as values.
A successful response will contain three to four Link
headers:
-
rel=alternate
links to the description page of the codepoint on the main site. -
rel=up
links to the API endpoint for the containing Unicode block. -
rel=prev
links to the previous codepoint, if it exists. -
rel=next
links to the next codepoint, if it exists.
- 400 Bad Request: If the value for
{codepoint}
is not a valid hexadecimal number. - 404 Not Found: If the value for
{codepoint}
is no recognized codepoint (but a valid hexadecimal number).