Back to APIs list

Mastodon API examples & templates

Use these vals as a playground to view and fork Mastodon API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
geraldo avatar
testPostToMastodon
@geraldo
script
An interactive, runnable TypeScript val by geraldo
geraldo avatar
tootLatestPosts
@geraldo
interval
Auto-tooting anniversary posts from https://crimenesdeodio.info/ to remember hate crimes in Spain between 1990-2020.
jdan avatar
myspace
@jdan
http
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
stevekrouse avatar
myspace
@stevekrouse
http
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
alana avatar
myspace
@alana
http
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
vladimyr avatar
publicKeyPem_example
@vladimyr
script
// SPDX-License-Identifier: 0BSD
jaandrle avatar
TODO_tootLatestPosts
@jaandrle
interval
See https://sebastiandedeyne.com/auto-tooting-new-posts-with-val-town
jaandrle avatar
mastodon$collectStats
@jaandrle
script
// https://api.val.town/eval/@jaandrle.mastodon$collectStats(@jaandrle.mastodon$instances_cz, 1)
jaandrle avatar
mastodon$fetchInstanceStats
@jaandrle
script
An interactive, runnable TypeScript val by jaandrle
sebdd avatar
tootLatestPosts
@sebdd
script
An interactive, runnable TypeScript val by sebdd
jaandrle avatar
mastodon$stats_cz_week
@jaandrle
script
No. of statuses, login (~active users) and new registrations for all Czech instances of Mastodon last week.
tmcw avatar
activitypub
@tmcw
http
WebFinger This is a not-quite-complete ActivityPub implementation based on my blog post about building an AP implementation . It includes enough to look up bot@tmcw-activitypub.web.val.run on Mastodon and get some basic information.
sebdd avatar
postToMastodon
@sebdd
script
An interactive, runnable TypeScript val by sebdd
jaandrle avatar
mastodon$sumStats
@jaandrle
script
An interactive, runnable TypeScript val by jaandrle
jaandrle avatar
mastodon$instances_cz_stats_last_week
@jaandrle
script
No. of statuses, login (~active users) and new registrations in Czech instances of Mastodon last week.