Bluesky post character counter
Markdown versionGET/tools/character-counter
Counts a post's length the way Bluesky does (graphemes, limit 300; UTF-8 bytes, limit 3000) and, when it is too long, splits it into thread parts that each fit.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| text (required) | query | string | The text of the post, up to 10,000 characters. |
| numbered | query | boolean, default true | End each thread part with ` 1/3`, ` 2/3`… |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The tool's answer, with the canonical URL of its page. | ToolCharacterCounter |
| 400 | Invalid query parameter (code `bad_request`). | Error |
| 401 | Unknown, expired or revoked token (code `unauthorized`). Without an `Authorization` header, the tool answers anonymously. | Error |
| 404 | Not found. Also returned on a bot's handle subdomain: the API is only served on the main site. | Error |
| 429 | Rate limited: `toolsApi` (60 a minute) and `toolsApiDaily` (2,000 a day) per IP, or 10 times both per account with a creator's token. A tool that fans out costs more than one call. | Error |
| 500 | Unexpected error. | Error |
Example
curl \
-G \
--data-urlencode "text=Hello Bluesky! 👋" \
-H "Authorization: Bearer $BLUESKY_BOT_TOKEN" \
https://bluesky.bot/api/v1/tools/character-counterSchemas
Error
| Field | Type | Description |
|---|---|---|
| error (required) | object | |
| error.code (required) | string: "bad_request", "invalid_handle", "not_found", "rate_limited", "internal_error", "unauthorized", "forbidden", "conflict", "invalid_grant", "upstream_error", "insufficient_scope", "invalid_listing", "consent_required" | |
| error.message (required) | string | |
| error.reason | string | With `invalid_handle`, `invalid_listing`, `conflict` and `forbidden`: e.g. `reserved`, `taken`, `too_long`, `no_handle`, `suspended`. |
| error.url | string, uri | With consent_required: open this dashboard page to grant profile editing. |
| error.field | string | With `invalid_listing`: the refused field. |
| error.scope | string | With `insufficient_scope`: the scope the token lacks. |
| error.parameter | string | The invalid query parameter. |
| error.retryAfterSeconds | integer (1–) | With `rate_limited`. |
ToolCharacterCounter
| Field | Type | Description |
|---|---|---|
| tool (required) | string = "character-counter" | The tool's slug. |
| url (required) | string | The canonical URL of the tool's page on Bluesky.bot. |
| result (required) | object | The tool's answer. |
| result.graphemes (required) | integer | Length in graphemes: what a reader sees as one character (an emoji, a flag, a letter with its accent). |
| result.bytes (required) | integer | Size in UTF-8 bytes. |
| result.graphemesLeft (required) | integer | Graphemes left before the limit; negative when over. |
| result.bytesLeft (required) | integer | Bytes left before the limit; negative when over. |
| result.over (required) | boolean | Over either limit: Bluesky would refuse it. |
| result.limits (required) | object | The limits of a post's text. |
| result.limits.graphemes (required) | integer | Bluesky's limit: 300. |
| result.limits.bytes (required) | integer | Bluesky's limit: 3000. |
| result.parts (required) | object[] | The thread, when the text is over a limit: parts cut at a paragraph, a sentence or a space. Empty when it fits. |
| result.parts[].text (required) | string | The part's text, numbered when asked. |
| result.parts[].graphemes (required) | integer | The part's length in graphemes. |
| result.parts[].bytes (required) | integer | The part's size in UTF-8 bytes. |
| result.parts[].over (required) | boolean | The part is still too long: a single grapheme bigger than a post. |