back

counters

activitypub extension providing global counters on objects, allowing easier federation of object statistics

this is a draft, expect changes!

namespaces

abbreviated prefix full IRI
as https://www.w3.org/ns/activitystreams/#
xsd https://www.w3.org/TR/xmlschema11-2/#
counters https://ns.alemi.dev/as/counters/#

counters:followersCount 🔗

this optional field shows, on Actor objects, the number of other actors following the subject

this number is usually available (if public) as totalItems inside the followers collection, however this cannot be embedded in the Actor itself, as ActivityPub dictates the followers fields should be a link to a collection, and not an embedded collection

to prevent multiple fetches when resolving an actor, this field shows the current number right away

counters:followingCount 🔗

this optional field shows, on Actor objects, the number of actors followed by the subject

this number is usually available (if public) as totalItems inside the following collection, however this cannot be embedded in the Actor itself, as ActivityPub dictates the following fields should be a link to a collection, and not an embedded collection

to prevent multiple fetches when resolving an actor, this field shows the current number right away

counters:statusesCount 🔗

this optional field shows, on Actor objects, the number of statuses attributed to them

this number may be visible in the outbox collection, but it's not usually available globally

to allow remote servers to get a grasp of how active users are, servers may display this metric (if allowed by the user)

example

{
	"@context": [
		"https://www.w3.org/ns/activitystreams",
		{
			"counters": "https://ns.alemi.dev/as/counters/#",
			"followersCount": "counters:followersCount",
			"followingCount": "counters:followingCount",
			"statusesCount": "counters:statusesCount",
		}
	],
	"id": "https://example.net/users/actor",
	"following": "https://example.net/users/actor/following",
	"followingCount": 1312,
	"followers": "https://example.net/users/actor/followers",
	"followersCount": 42,
	"inbox": "https://example.net/users/actor/inbox",
	"outbox": "https://example.net/users/actor/outbox",
	"statusesCount": 9001,
	"name": "Test Actor",
	"summary": "manually generated actor",
	"preferredUsername": "actor",
	"type": "Person",
}