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": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://gotosocial/users/cookie"
  ],
  "id": "http://pasture-one-actor/activity/SAxRkCXCRcY",
  "published": "2025-09-06T13:17:37Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://gotosocial/users/cookie"
    ],
    "id": "http://pasture-one-actor/object/bNXls3emwDA",
    "published": "2025-09-06T13:17:37Z",
    "content": "text",
    "tag": [
      {
        "type": "Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
gotosocial
{
  "id": "01K4FJSPB8VJ7HCBXHCA9VVCMG",
  "created_at": "2025-09-06T13:17:37.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/bNXls3emwDA",
  "url": "http://pasture-one-actor/object/bNXls3emwDA",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "text",
  "reblog": null,
  "account": {
    "id": "01K4FJSETK0FS940FPRWEABH14",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": true,
    "discoverable": false,
    "bot": false,
    "created_at": "2025-09-06T13:17:29.311Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "header": "http://gotosocial/assets/default_header.png",
    "header_static": "http://gotosocial/assets/default_header.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 14,
    "last_status_at": "2025-09-06T13:17:37.000Z",
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [
    {
      "id": "01MGBGEF2AAH8AGFWQ8MCA8WK5",
      "username": "cookie",
      "url": "http://gotosocial/@cookie",
      "acct": "cookie"
    }
  ],
  "tags": [
    {
      "name": "test",
      "url": "http://gotosocial/tags/test"
    }
  ],
  "emojis": [],
  "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": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://gotosocial/users/cookie"
  ],
  "id": "http://pasture-one-actor/activity/yyiYfuTZfug",
  "published": "2025-09-06T13:17:38Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://gotosocial/users/cookie"
    ],
    "id": "http://pasture-one-actor/object/5ppn63c9bTA",
    "published": "2025-09-06T13:17:38Z",
    "content": "using as:Hashtag",
    "tag": [
      {
        "type": "as:Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
gotosocial
{
  "id": "01K4FJSQAGXM9QBV71JTFMJW1H",
  "created_at": "2025-09-06T13:17:38.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/5ppn63c9bTA",
  "url": "http://pasture-one-actor/object/5ppn63c9bTA",
  "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,
  "account": {
    "id": "01K4FJSETK0FS940FPRWEABH14",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": true,
    "discoverable": false,
    "bot": false,
    "created_at": "2025-09-06T13:17:29.311Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "header": "http://gotosocial/assets/default_header.png",
    "header_static": "http://gotosocial/assets/default_header.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 15,
    "last_status_at": "2025-09-06T13:17:38.000Z",
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [
    {
      "id": "01MGBGEF2AAH8AGFWQ8MCA8WK5",
      "username": "cookie",
      "url": "http://gotosocial/@cookie",
      "acct": "cookie"
    }
  ],
  "tags": [],
  "emojis": [],
  "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": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://gotosocial/users/cookie"
  ],
  "id": "http://pasture-one-actor/activity/Vn6q4L-xTFs",
  "published": "2025-09-06T13:17:39Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://gotosocial/users/cookie"
    ],
    "id": "http://pasture-one-actor/object/Zq39dZ_ePz0",
    "published": "2025-09-06T13:17:39Z",
    "content": "no type \u26a0\ufe0f ",
    "tag": [
      {
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
gotosocial
{
  "id": "01K4FJSR9RJCDA6HZA12589R32",
  "created_at": "2025-09-06T13:17:39.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/Zq39dZ_ePz0",
  "url": "http://pasture-one-actor/object/Zq39dZ_ePz0",
  "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,
  "account": {
    "id": "01K4FJSETK0FS940FPRWEABH14",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": true,
    "discoverable": false,
    "bot": false,
    "created_at": "2025-09-06T13:17:29.311Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "header": "http://gotosocial/assets/default_header.png",
    "header_static": "http://gotosocial/assets/default_header.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 16,
    "last_status_at": "2025-09-06T13:17:39.000Z",
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [
    {
      "id": "01MGBGEF2AAH8AGFWQ8MCA8WK5",
      "username": "cookie",
      "url": "http://gotosocial/@cookie",
      "acct": "cookie"
    }
  ],
  "tags": [],
  "emojis": [],
  "card": null,
  "poll": null
}

Example 4

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://gotosocial/users/cookie"
  ],
  "id": "http://pasture-one-actor/activity/2DT2t6x4D4Q",
  "published": "2025-09-06T13:17:39Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://gotosocial/users/cookie"
    ],
    "id": "http://pasture-one-actor/object/uByOccjHLys",
    "published": "2025-09-06T13:17:39Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context \u26a0\ufe0f ",
    "tag": [
      {
        "type": "Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
gotosocial
{
  "id": "01K4FJSR9RMCZNW47VP228YSWY",
  "created_at": "2025-09-06T13:17:39.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/uByOccjHLys",
  "url": "http://pasture-one-actor/object/uByOccjHLys",
  "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,
  "account": {
    "id": "01K4FJSETK0FS940FPRWEABH14",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": true,
    "discoverable": false,
    "bot": false,
    "created_at": "2025-09-06T13:17:29.311Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "header": "http://gotosocial/assets/default_header.png",
    "header_static": "http://gotosocial/assets/default_header.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 17,
    "last_status_at": "2025-09-06T13:17:39.000Z",
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [
    {
      "id": "01MGBGEF2AAH8AGFWQ8MCA8WK5",
      "username": "cookie",
      "url": "http://gotosocial/@cookie",
      "acct": "cookie"
    }
  ],
  "tags": [
    {
      "name": "test",
      "url": "http://gotosocial/tags/test"
    }
  ],
  "emojis": [],
  "card": null,
  "poll": null
}

Example 5

activity
{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "actor": "http://pasture-one-actor/actor",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "http://gotosocial/users/cookie"
  ],
  "id": "http://pasture-one-actor/activity/uPTP7_QW15g",
  "published": "2025-09-06T13:17:40Z",
  "object": {
    "type": "Note",
    "attributedTo": "http://pasture-one-actor/actor",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "http://gotosocial/users/cookie"
    ],
    "id": "http://pasture-one-actor/object/6MI5IV1CqTE",
    "published": "2025-09-06T13:17:40Z",
    "@context": "https://www.w3.org/ns/activitystreams",
    "content": "Hashtag not in @context; as:Hashtag",
    "tag": [
      {
        "type": "as:Hashtag",
        "name": "#test"
      },
      {
        "type": "Mention",
        "href": "http://gotosocial/users/cookie"
      }
    ]
  }
}
gotosocial
{
  "id": "01K4FJSS90T1ZA4T3S254KY3NV",
  "created_at": "2025-09-06T13:17:40.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/6MI5IV1CqTE",
  "url": "http://pasture-one-actor/object/6MI5IV1CqTE",
  "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,
  "account": {
    "id": "01K4FJSETK0FS940FPRWEABH14",
    "username": "actor",
    "acct": "actor@pasture-one-actor",
    "display_name": "Test Actor",
    "locked": true,
    "discoverable": false,
    "bot": false,
    "created_at": "2025-09-06T13:17:29.311Z",
    "note": "",
    "url": "http://pasture-one-actor/actor",
    "avatar": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "avatar_static": "http://gotosocial/assets/default_avatars/GoToSocial_icon4.png",
    "header": "http://gotosocial/assets/default_header.png",
    "header_static": "http://gotosocial/assets/default_header.png",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 18,
    "last_status_at": "2025-09-06T13:17:40.000Z",
    "emojis": [],
    "fields": []
  },
  "media_attachments": [],
  "mentions": [
    {
      "id": "01MGBGEF2AAH8AGFWQ8MCA8WK5",
      "username": "cookie",
      "url": "http://gotosocial/@cookie",
      "acct": "cookie"
    }
  ],
  "tags": [],
  "emojis": [],
  "card": null,
  "poll": null
}