Skip to content

Hashtags and JSON-LD

The examples here are various variations of creating the Hashtag element in the tag list. These variations can be useful in understanding how strict an application sees JSON-LD.

Hashtags are a good illustration of JSON-LD parsing as Hashtag is not part of the ActivityStreams vocabulary.

All examples except the first are questionable, and probably should not be used when publishing to the Fediverse. The examples marked with ⚠️ are expected to fail with a JSON-LD parser. The examples using as:Hashtag are expected to fail with a JSON only parser.

Examples

Example 1

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/NXr3Usja9hU",
  "published": "2025-08-30T19:19:49Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/object/zyEmPDVDsh4",
    "published": "2025-08-30T19:19:49Z",
    "content": "text",
    "tag": {
      "type": "Hashtag",
      "name": "#test"
    }
  }
}
mastodon
{
  "id": "115119331087388213",
  "created_at": "2025-08-30T19:19:49.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/zyEmPDVDsh4",
  "url": "http://pasture-one-actor/object/zyEmPDVDsh4",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "text",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "115119330135899832",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-08-30T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 14,
    "last_status_at": "2025-08-30",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [
    {
      "name": "test",
      "url": "http://mastodon/tags/test"
    }
  ],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}

Example 2

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/FsfKL1jFF2U",
  "published": "2025-08-30T19:19:50Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/object/WbbK2gWqO7c",
    "published": "2025-08-30T19:19:50Z",
    "content": "using as:Hashtag",
    "tag": {
      "type": "as:Hashtag",
      "name": "#test"
    }
  }
}
mastodon
{
  "id": "115119331152238445",
  "created_at": "2025-08-30T19:19:50.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/WbbK2gWqO7c",
  "url": "http://pasture-one-actor/object/WbbK2gWqO7c",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "using as:Hashtag",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "115119330135899832",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-08-30T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 15,
    "last_status_at": "2025-08-30",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}

Example 3

activity
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    {
      "Hashtag": "as:Hashtag",
      "sensitive": "as:sensitive"
    }
  ],
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/L5G3NCul_ho",
  "published": "2025-08-30T19:19:51Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/object/3KPehbRb_Bw",
    "published": "2025-08-30T19:19:51Z",
    "content": "no type \u26a0\ufe0f ",
    "tag": {
      "name": "#test"
    }
  }
}
mastodon
{
  "id": "115119331223565204",
  "created_at": "2025-08-30T19:19:51.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/3KPehbRb_Bw",
  "url": "http://pasture-one-actor/object/3KPehbRb_Bw",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "no type \u26a0\ufe0f ",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "115119330135899832",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-08-30T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 16,
    "last_status_at": "2025-08-30",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}

Example 4

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/P061RNcIfvk",
  "published": "2025-08-30T19:19:52Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/object/qUMgynYLqg0",
    "published": "2025-08-30T19:19:52Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context \u26a0\ufe0f ",
    "tag": {
      "type": "Hashtag",
      "name": "#test"
    }
  }
}
mastodon
{
  "id": "115119331294940413",
  "created_at": "2025-08-30T19:19:52.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/qUMgynYLqg0",
  "url": "http://pasture-one-actor/object/qUMgynYLqg0",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Hashtag not in @context \u26a0\ufe0f ",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "115119330135899832",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-08-30T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 17,
    "last_status_at": "2025-08-30",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [
    {
      "name": "test",
      "url": "http://mastodon/tags/test"
    }
  ],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}

Example 5

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://mastodon/users/hippo",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/pr5V27LQbXQ",
  "published": "2025-08-30T19:19:53Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://mastodon/users/hippo"
    ],
    "id": "http://pasture-one-actor/object/ltlDKswKmfc",
    "published": "2025-08-30T19:19:53Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context; as:Hashtag",
    "tag": {
      "type": "as:Hashtag",
      "name": "#test"
    }
  }
}
mastodon
{
  "id": "115119331359750336",
  "created_at": "2025-08-30T19:19:53.000Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/ltlDKswKmfc",
  "url": "http://pasture-one-actor/object/ltlDKswKmfc",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "edited_at": null,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "content": "Hashtag not in @context; as:Hashtag",
  "filtered": [],
  "reblog": null,
  "account": {
    "id": "115119330135899832",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "discoverable": false,
    "indexable": false,
    "group": false,
    "created_at": "2025-08-30T00:00:00.000Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "uri": "http://pasture-one-actor/actor",
    "avatar": "http://mastodon/avatars/original/missing.png",
    "avatar_static": "http://mastodon/avatars/original/missing.png",
    "header": "http://mastodon/headers/original/missing.png",
    "header_static": "http://mastodon/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 18,
    "last_status_at": "2025-08-30",
    "hide_collections": true,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "quote": null,
  "card": null,
  "poll": null
}