---
id: "hashtag"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["texts", "internet"]
langs: ["common"]
quality: 90
url: "https://registry.apicrafter.io/datatype/hashtag"
---

# Hashtag (`hashtag`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Keyword marked with the # sign in social media posts and messages, used to group posts on one topic. It may contain letters of any script, digits and underscores, but no spaces or punctuation. X (Twitter) and Mastodon do not link a tag made only of digits, so the regexp requires at least one letter. Wikidata property P2572 stores hashtags without the # sign; the regexp requires it, because without it a hashtag is an ordinary word. Python matches letters of all scripts; the browser regexp engine matches only Latin letters, and neither matches combining vowel signs of Indic scripts.

- Personal data (PII): no
- Categories: Texts and  articles (texts), Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^#\w*[^\W\d_]\w*$
```

## Examples

- `#ww2` — World War II (Wikidata P2572)
- `#спорт` — Sport, in Russian (Wikidata P2572)
- `#16` (invalid example) — Digits only, not linked as a hashtag
- `#open data` (invalid example) — A space ends the hashtag

## Mappings

- wikidata: `P2572`

## Translations

- ru: Хештег: Ключевое слово со знаком # в публикациях социальных сетей. Состоит из букв, цифр и знаков подчёркивания, без пробелов; тег только из цифр не считается хештегом.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Hashtag>
- wikidata: <https://www.wikidata.org/wiki/Property:P2572>
- doc: <https://github.com/twitter/twitter-text/blob/master/conformance/extract.yml>

## Quality

Score 90/100. Missing: detector coverage.

JSON: <https://registry.apicrafter.io/api/v1/datatypes/hashtag.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/texts/hashtag.yaml>
