Linking the Cashtag and Character Counting

Link the Cashtag

Linking Cashtags (eg. $GOOG) can be done easily, Stocktwits has a library that provides text processing routines for cashtags within messages. The major reason for this is to unify the various auto-linking and extraction of cashtags and to keep everything up to date with the Stocktwits symbology. This library provides autolinking and extraction for cashtags, it's available on Github:

Note: Linking URLs within a messages must always link to the original source. You can not unwrap or change a link in any way when displaying the url or linking within it.

We recommend using the Twitter text-js Library for linking URLs. The library provides autolinking and extraction for URLs. You will find it on Github:

Counting Characters

Stocktwits limits message length to 1000 characters. URLs are one thing that effects character counting. Any message over 1000 characters will return and error response.

Character Encoding

The Stocktwits API supports UTF-8 encoding and any UTF-8 character counts as a single character. Please note that angle brackets ("<" and ">") are entity-encoded to prevent Cross-Site Scripting attacks for web-embedded consumers of JSON API output. The resulting encoded entities do count towards the 1000 character limit. Symbols and characters outside of the standard ASCII range may be translated to HTML entities.

URL/Links such as "" will be automatically converted to or links and will represent "20" characters in a message count. You will not need to worry about shortening a link before you create a message. Links are defined as having a protocol such as "http://" or "https://".