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://hollo/@john",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/YOrfi9ZIwEo",
  "published": "2025-09-01T07:36:02Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/object/PwzA7tDDJkE",
    "published": "2025-09-01T07:36:02Z",
    "content": "text",
    "tag": [
      {
        "type": "Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://hollo/@john"
      }
    ]
  }
}
hollo
{
  "id": "01990434-52d0-7ab8-bf7d-9158aaf7cf2c",
  "created_at": "2025-09-01T07:36:02.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/PwzA7tDDJkE",
  "url": "http://pasture-one-actor/object/PwzA7tDDJkE",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "text",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "01990434-311e-7d45-9172-cd7da0632fe2",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2025-09-01T07:35:53.312Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": 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://hollo/@john",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/BehJUq2JoXI",
  "published": "2025-09-01T07:36:03Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/object/aYI8jHiBaqI",
    "published": "2025-09-01T07:36:03Z",
    "content": "using as:Hashtag",
    "tag": [
      {
        "type": "as:Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://hollo/@john"
      }
    ]
  }
}
hollo
{
  "id": "01990434-56b8-7f85-a024-c8e745dac4ef",
  "created_at": "2025-09-01T07:36:03.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/aYI8jHiBaqI",
  "url": "http://pasture-one-actor/object/aYI8jHiBaqI",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "using as:Hashtag",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "01990434-311e-7d45-9172-cd7da0632fe2",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2025-09-01T07:35:53.312Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": 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://hollo/@john",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/XpRL74UhMT4",
  "published": "2025-09-01T07:36:04Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/object/VpaE149n6Dc",
    "published": "2025-09-01T07:36:04Z",
    "content": "no type \u26a0\ufe0f ",
    "tag": [
      {
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://hollo/@john"
      }
    ]
  }
}
hollo
{
  "id": "01990434-5aa0-750d-9a46-50dbd1f38362",
  "created_at": "2025-09-01T07:36:04.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/VpaE149n6Dc",
  "url": "http://pasture-one-actor/object/VpaE149n6Dc",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "no type \u26a0\ufe0f ",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "01990434-311e-7d45-9172-cd7da0632fe2",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2025-09-01T07:35:53.312Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}

Example 4

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://hollo/@john",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/Q60f43ilj_U",
  "published": "2025-09-01T07:36:05Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/object/0-xSy_9tbMk",
    "published": "2025-09-01T07:36:05Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context \u26a0\ufe0f ",
    "tag": [
      {
        "type": "Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://hollo/@john"
      }
    ]
  }
}
hollo
{
  "id": "01990434-5e88-72f6-8e5a-b69002ea6dd9",
  "created_at": "2025-09-01T07:36:05.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/0-xSy_9tbMk",
  "url": "http://pasture-one-actor/object/0-xSy_9tbMk",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Hashtag not in @context \u26a0\ufe0f ",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "01990434-311e-7d45-9172-cd7da0632fe2",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2025-09-01T07:35:53.312Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}

Example 5

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "http://hollo/@john",
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "id": "http://pasture-one-actor/activity/yY1-o-cHMdc",
  "published": "2025-09-01T07:36:06Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://hollo/@john"
    ],
    "id": "http://pasture-one-actor/object/W6WDBSE39_s",
    "published": "2025-09-01T07:36:06Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context; as:Hashtag",
    "tag": [
      {
        "type": "as:Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://hollo/@john"
      }
    ]
  }
}
hollo
{
  "id": "01990434-6270-7a9b-98e6-4a8b98375b5e",
  "created_at": "2025-09-01T07:36:06.000Z",
  "in_reply_to_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": null,
  "uri": "http://pasture-one-actor/object/W6WDBSE39_s",
  "url": "http://pasture-one-actor/object/W6WDBSE39_s",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "Hashtag not in @context; as:Hashtag",
  "reblog": null,
  "quote_id": null,
  "quote": null,
  "application": null,
  "account": {
    "id": "01990434-311e-7d45-9172-cd7da0632fe2",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": false,
    "bot": false,
    "created_at": "2025-09-01T07:35:53.312Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://hollo/image/avatars/original/missing.png",
    "avatar_static": "http://hollo/image/avatars/original/missing.png",
    "header": "http://hollo/image/headers/original/missing.png",
    "header_static": "http://hollo/image/headers/original/missing.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 0,
    "moved": null,
    "last_status_at": null,
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "card": null,
  "emojis": [],
  "emoji_reactions": [],
  "poll": null,
  "filtered": null
}