Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

What are the activity_id formats for various platforms?

Fediverse
12 5 84
  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    From my own experience querying public mastodon timelines via API (edit: removed incorrect /api/v1s in the AP_IDs):

    • Mastodon user accounts have an ActivityPub URI of https://<instance.domain.tld>/users/<username>
    • Mastodon posts have an ActivityPub URI of https://<instance.domain.tld>/users/<post_author_username>/statuses/<post_id> (they also have a url property of https://<instance.domain.tld>/@<post_author_username>/<post_id> but that tends to serve the html view of the post)

    To see for yourself, pick an instance that allows viewing their public timeline without logging in (mastodon.social is perfect for this) and follow the "Playing with public data" section of the docs. That page ellides most of the info you're looking for in the example payloads they give (as the JSON payloads themself are quite large and nested), but I can assure you that AP_IDs for user accounts and posts can be found pretty quickly from a single timeline query.

    I don't think Mastodon has any notion of community, nor does it distinguish between posts and comments (when following a lemmy community, both posts and comments show up in my masto feed as "top-level" statuses (ie posts)).

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I’ve rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I’m loving this as it makes things so much faster and easier.

    Isn't that the whole point of webfinger? Moreover, why would you paint yourself into a corner and hardcode the logic for all the different types of services, if ActivityPub uses JSON-LD and therefore provides a straightforward method for document dereferencing?

    I'm not trying to be snarky. It's just that I'm writing ActivityPub server where the id of each object is just an ULID, because to the server there is zero difference between serving the information about an actor or an activity.

  • From my own experience querying public mastodon timelines via API (edit: removed incorrect /api/v1s in the AP_IDs):

    • Mastodon user accounts have an ActivityPub URI of https://<instance.domain.tld>/users/<username>
    • Mastodon posts have an ActivityPub URI of https://<instance.domain.tld>/users/<post_author_username>/statuses/<post_id> (they also have a url property of https://<instance.domain.tld>/@<post_author_username>/<post_id> but that tends to serve the html view of the post)

    To see for yourself, pick an instance that allows viewing their public timeline without logging in (mastodon.social is perfect for this) and follow the "Playing with public data" section of the docs. That page ellides most of the info you're looking for in the example payloads they give (as the JSON payloads themself are quite large and nested), but I can assure you that AP_IDs for user accounts and posts can be found pretty quickly from a single timeline query.

    I don't think Mastodon has any notion of community, nor does it distinguish between posts and comments (when following a lemmy community, both posts and comments show up in my masto feed as "top-level" statuses (ie posts)).

    Cool, thanks. I was close with /user guessing from memory.

    I think the /users/.../post_id will be sufficient. It just needs to know that the given URL is an AP_ID before passing it off to the API call to resolveObject. Since it already knows instance.domain.tld is a federated instance, it just needs to see if the path is an AP_ID or the HTML (or something else). Thus, I don't have to parse the whole thing, just check that enough of it matches.

    Thanks!

  • So, I’ve rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I’m loving this as it makes things so much faster and easier.

    Isn't that the whole point of webfinger? Moreover, why would you paint yourself into a corner and hardcode the logic for all the different types of services, if ActivityPub uses JSON-LD and therefore provides a straightforward method for document dereferencing?

    I'm not trying to be snarky. It's just that I'm writing ActivityPub server where the id of each object is just an ULID, because to the server there is zero difference between serving the information about an actor or an activity.

    We've had this discussion :)

    This application is written against the Lemmy API. It only speaks API. Eventually it'll speak Piefed API as well, but right now, only Lemmy API.

    Lemmy and Piefed only do server-to-server Activity Pub and not client-to-server AP. Clients have to use the API to interact with them. This is a Lemmy (and eventually Piefed) client.

  • We've had this discussion :)

    This application is written against the Lemmy API. It only speaks API. Eventually it'll speak Piefed API as well, but right now, only Lemmy API.

    Lemmy and Piefed only do server-to-server Activity Pub and not client-to-server AP. Clients have to use the API to interact with them. This is a Lemmy (and eventually Piefed) client.

    But then why do you worry about the ap_id patterns from other software?

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    admiralpatrick@lemmy.world I think you would be better served by checking for the Link header. NodeBB and WordPress do it, if that gives you some idea of implementation?

  • It took me a minute to find, but it is detailed in evan@cosocial.ca's write up about HTTP Discovery of ActivityPub Objects.

    This is probably exactly what you're looking for.

    https://swicg.github.io/activitypub-html-discovery/

    I think your current approach has merit but is limited. If you know the instance software by URL and can resolve it using path matching without the use of a pre-flight request, that's absolutely a better way forward. The downside is you have to know the URL patterns of every software. You'll never "catch 'em all"!

    However, if that method fails, doing a pre-flight check to grab Link also works and is a viable way forward.

    You can test against NodeBB users or posts.

  • But then why do you worry about the ap_id patterns from other software?

    I'm making an "omnisearch" box.

    Paste in an AP_ID into the search field, and it auto-resolves it and redirects you to your instance's local copy (which is very fast) instead of going through the whole search process (which is slow). To prevent false positives, I'm matching the various ap_id formats and only doing the resolution on those; anything else gets passed to search.

    Anything else that falls through the cracks just gets passed to search as usual (which also does a resolveObject lookup).

    It's to make life easier.

  • I think you would be better served by checking for the Link header

    Can't really do that, client-side, in a browser application. CORS is a perpetual cockblock (though I understand why it is), and I'd rather not make an internal API endpoint to do the lookup.

    The application polls Lemmy's getFederatedInstances API endpoint at startup, so it has a list of every activity pub server your instance knows about. That's the first and primary check for the URL that's being searched.

    The second check is just to rule out non activity pub URLs that point to a federated instance (e..g. https://lemmy.world/modlog, https://lemm.world/pictrs/image/blah.webp, etc).

    Goal isn't to "catch 'em all" but to catch the most used ones. If there's one I don't account for, either by omission or because the federated platform didn't exist when I made the patterns, then it will just fall back to a regular search which also includes trying to resolve it as a federated URL (which is the current behavior in all prior versions).

    The goal is just to simply short-circuit the search behavior if the query is a known ap_id URL in order to avoid a lengthy search process and quickly redirect you to your instance's local copy.

  • TL;DR: Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    So, I've rewritten the search / search boxes in Tesseract to skip the search and directly resolve activity pub URLs for users, posts, comments, and communities. I'm loving this as it makes things so much faster and easier.

    To make that work, and reduce false positives/negatives, I have to do some pre-flight checks on the URL that's submitted to the search.

    Currently, it checks if the domain is to a known federated instance and looks for specific paths in the URL. If it detects the URL is an AP_ID URL, it will only resolve the object and redirect you to it (skipping the lengthy search step). For false negatives, it will pass it to the regular search but still try a federated lookup along with the search.

    For Lemmy and Piefed, those are:

    • /u/ for users
    • /c/ for communities
    • /post/ for posts
    • /comment/ for comments.

    For Mbin, I think it's the same except it uses /m/ for communities (they call them "magazines" I believe).

    I think mastoon uses /user or maybe /username/ in the AP identifiers?

    Any of you who are more familiar with Fediverse platforms that aren't Lemmy/Piefed, can you let me know what the AP_IDs look like for users, posts, comments, and, if applicable, communities?

    I maintain my own Lemmy client (Blorp), and this sounds like a cool idea. How do you get your known list of federated instances?

    I currently have my own threadiverse crawler I wrote, but I disregard any Lemmy/PieFed instance with <20 monthly active users. That brings the list down to about 63 Lemmy instances and 7 PieFed. I wonder if that list is extensive enough to implement the resolve object mechanism you mentioned.

  • I think you would be better served by checking for the Link header

    Can't really do that, client-side, in a browser application. CORS is a perpetual cockblock (though I understand why it is), and I'd rather not make an internal API endpoint to do the lookup.

    The application polls Lemmy's getFederatedInstances API endpoint at startup, so it has a list of every activity pub server your instance knows about. That's the first and primary check for the URL that's being searched.

    The second check is just to rule out non activity pub URLs that point to a federated instance (e..g. https://lemmy.world/modlog, https://lemm.world/pictrs/image/blah.webp, etc).

    Goal isn't to "catch 'em all" but to catch the most used ones. If there's one I don't account for, either by omission or because the federated platform didn't exist when I made the patterns, then it will just fall back to a regular search which also includes trying to resolve it as a federated URL (which is the current behavior in all prior versions).

    The goal is just to simply short-circuit the search behavior if the query is a known ap_id URL in order to avoid a lengthy search process and quickly redirect you to your instance's local copy.

    Can you not call fetch() to do a HEAD call? Maybe I'm mistaken about it but it should be ok.

    CORS is indeed a wrench that gets thrown in when you least expect it...


Gli ultimi otto messaggi ricevuti dalla Federazione
  • > If it's some automated feature, I don't think it should be in the source property of the federated JSON in the first place.

    Thanks, it's this.

    Edit: oh interesting, I looked into it. We serve the absolute URL in HTML but not in markdown. I had no idea threadiverse apps read the markdown. Neat!

    read more

  • Not sure if you're already aware, but that relative link there is broken in Lemmy, Mbin, and Piefed.

    If you used it manually, I'd suggest not using relative links in posts targeted at users from software that hasn't implemented them yet.

    If it's some automated feature, I don't think it should be in the source property of the federated JSON in the first place.

    read more

  • @rekall_incorporated@piefed.social said in [Fediverse wide cross-instance / cross-platform link substitution [UX improvement thoughts&rsqb;](/post/https%3A%2F%2Fpiefed.social%2Fc%2Ffediverse%2Fp%2F1568622%2Ffediverse-wide-cross-instance-cross-platform-link-substitution-ux-improvement-thoughts):
    > This issue is unresolved in Lemmy, but the Lemmy brand is permanently tainted among users who are looking for alternatives to American oligarchic technology services. The low moral standards of the Lemmy devs' (support for the brutal North Korean regime, promotion of russian propaganda narratives that they know are false) is a massive turn off for the exact target market of the Fediverse. It's a fact that many Europeans looking for alternatives instinctively recognize the demagoguery of the Lemmy devs and their fans.

    I don't think this is true at all.

    The average user doesn't know what Lemmy is, let alone the political views of their core development team.

    But don't worry, it's like that joke about vegans:

    How do you know the Lemmy devs are politically dubious? Don't worry, someone on the threadiverse will tell you.

    read more

  • How the links act is different from client to client. If you click the link in the Lemmy web UI, it will take you directly to Lemmy.wtf, but if you used Voyager (iOS client), it will automatically redirect to your own instance.

    This is something that should be built into the Lemmy web UI.

    You can also use browser addons. I have an addon that redirects me to my own instance, if I click on a link in my browser. I also have an addon that takes me from YouTube to Peertube, if the video also exist in PeerTube or if I click a PeerTube link, it takes me to my instance.

    Also how dare you criticise the awesome TLD .wtf, which is clearly an abbreviation of “What The Fediverse”?!

    read more

  • I've seen that being used. It works fine for more technical users, but it's just an extra pain point.

    If you make links, you need to apply the service Different UI from whatever instance/client/platform that you are using.

    I much prefer Piefed's soon to be released link substitution feature.

    read more

  • Mbin has had that feature for a while too

    read more

  • It's a temporary workaround but the experience is still clunky

    read more

  • Well; atleast for lemmy, there's https://lemmyverse.link/ ; which fixes exactly what you mention. You send that link, other people choose their instance in the redirect, and boom!

    read more
Post suggeriti
  • 0 Votes
    1 Posts
    6 Views
    In PieFed v1.4 it will be possible to label posts as having AI generated content. Labelled posts will get a little badge near their title, similar to how nsfw and nsfl content is labelled. Mods and authors can change this value on a post in the same way they do flair and nsfw, using the little tags button in the bottom right or in 'More options' when editing their post. Account settings for blocking: [image: rIJ6kQKrU9ygU9p.png] Similar to how NSFW works, each user can control how those posts are listed on the home page, etc. The default is 'Label as AI', which just adds the badge. People averse to AI-generated content might want to change this to 'Hide completely'. Also similar to NSFW, entire communities can be assigned as 'AI content' and that will auto-tag every post inside as being AI generated. If the community mods have this value unset (e.g. Lemmy communities, which don't have this functionality) then the instance admin can manually override the community's AI Generated setting.
  • 0 Votes
    1 Posts
    8 Views
    Now witness the power of this fully operational Fediverse!https://shkspr.mobi/blog/2025/11/now-witness-the-power-of-this-fully-operational-fediverse/How can you measure the popularity of a social network site? Perhaps by counting the number of active accounts, or the quality of the discourse, or even how many people reply to your witty memes.Me? I prefer to look at how many people visit my blog from each site. It is an imperfect measure - and a vain one - but lets me know where I should be spending my time. No point posting on a network which is just bots talking to each other, right?Earlier this year I built a stats-counter for my blog. Every time someone clicks from a website which links to my blog, it records that visit in a database. I get to see which blog posts are doing numbers, and where those numbers came from.Until fairly recently, the Mastodon social network didn't send referer details. I thought that reduced the visibility of the network and lobbied for it to change. As various Mastodon servers upgrade, and admins opt-in, it is becoming more apparent just how much traffic originates from the Fediverse.Over the last few weeks, here's how many people have clicked from BlueSky and Mastodon to one of my blog posts.TotalSource1,607bsky.app752mastodon.socialAt first glance, it doesn't look good for our elephantine friends, does it? The butterfly sends over twice the traffic. Game over!But, of course, while Mastodon.social is the biggest instance - it is far from the only one. What happens if we slide down the long tail? Here's all the Mastodon-ish instances which sent me over 10 clicks.TotalSource193phanpy.social120 android-app://org.joinmastodon.android/106infosec.exchange62mas.to59mstdn.social55social.vivaldi.net49wandering.shop48fosstodon.org33mathstodon.xyz27mastodon.online26mastodon.scot24app.wafrn.net19indieweb.social18social.lol17tech.lgbt17toot.wales16en.osm.town16feditrends.com14mstdn.ca14piefed.social12wetdry.world11c.im11mastodon.nl51 Sites sending < 10 clicksAh! Add them all up and you get a grand total of 1,773 visitors from Mastodon-powered sites. That's more than BlueSky.Now, there are some obvious caveats to the data:I have a smaller follower count on BlueSky than I do on Mastodon.My posts may appeal more to one demographic than another.People may have strict privacy controls which suppress the true volume of visitors.There's no way to measure how long someone spends reading my posts.RSS and newsletter visitors aren't counted.Clicks from apps may not always show a referer.Some people may be on multiple services.Fediverse users can follow the post directly, so don't need to visit the site to read it.And yet… no matter how you slice it, Fediverse servers are sending as much traffic as BlueSky!I think this is brilliant. Web services should be able to scale from small to big - and each ActivityPub-powered site helps power the open Internet.Just for completeness, this is how Reddit, Facebook, LinkedIn, Twitter, and Lemmy do over the same period:TotalSource1,158reddit.com585 android-app://com.reddit.frontpage/76facebook.com76https://old.reddit.com/r/programming/56https://www.reddit.com/r/programming/52youtube.com41t.co38https://old.reddit.com/r/todayilearned/comments/1nsw7f4/til_in_mongolia_instead_of_a_street_address_a/31linkedin.com27 android-app://io.syncapps.lemmy_sync/27https://www.reddit.com/r/todayilearned/comments/1nsw7f4/til_in_mongolia_instead_of_a_street_address_a/22https://old.reddit.com/r/programming/comments/1n96ftn/40_years_later_are_bentleys_programming_pearls/22lemmy.ca17 android-app://com.linkedin.android/16lemmy.dbzer0.com14feddit.org11https://www.reddit.com/r/programming/comments/1n96ftn/40_years_later_are_bentleys_programming_pearls/10discuss.tchncs.de10l.instagram.com8lemmy.blahaj.zone6https://www.reddit.com/r/GrapheneOS/comments/1m2l84b/considering_making_the_switch_does_google_pay/6reddthat.comIf you add up all the Lemmy instances, they send about as much traffic as Facebook and LinkedIn combined. That's not a huge surprise - those platforms hate anyone clicking away to the wider web.Twitter is basically the Dead Internet. I'm no longer on there, but I do occasionally search it to see who is sharing my posts. The popular posts I write get shared a lot - sometimes by accounts with huge followers - yet there are no comments or retweets and barely and clicks.I don't do Instagram or Threads, and that might be reflected in their low numbers. But I'm not active on YouTube either - yet people there occasionally link back to me.Final ThoughtsFirstly, my stats only represent my site. Your site might be very different.Secondly, I've ignored search engine traffic, big blogs, newsletters, and other sources.Thirdly, and most importantly, this isn't a competition! The desire for a "winner-takes-all" service is dangerous and disturbing. An ecosystem is at its most vibrant when there are multiple participants each thriving in their own niche.I want a thousand sites, running a hundred different software stacks, some of which only serve a dozen people, or even a lone participant.Diversity is strength.#activitypub #bluesky #fediverse #mastodon #statistics
  • 0 Votes
    1 Posts
    8 Views
    How far will it go this time? This post from #Mastodon can reach the whole #Fediverse, #Bluesky & more. That's #Sharkey, #Misskey, #Pixelfed, #Mbin, #Lemmy, #Friendica, #Hometown, #Akkoma… If you see it, please share it.#SocialMedia @fediverseFirst results 👇🏼
  • 0 Votes
    2 Posts
    14 Views
    @GillesLeCorre2 bonne journée a toi.