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.
ejfox avatar
mastodon
@ejfox
HTTP
// This val fetches the 10 most recent Mastodon posts using the Mastodon API.
geraldo avatar
testPostToMastodon
@geraldo
Script
An interactive, runnable TypeScript val by geraldo
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
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.
jaandrle avatar
mastodon$instances_cz
@jaandrle
Script
An interactive, runnable TypeScript val by jaandrle
sebdd avatar
postToMastodon
@sebdd
Script
An interactive, runnable TypeScript val by sebdd
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.
geraldo avatar
tootLatestPosts
@geraldo
Cron
Forked from sebdd/tootLatestPosts
sebdd avatar
tootLatestPosts
@sebdd
Script
An interactive, runnable TypeScript val by sebdd
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.
jaandrle avatar
TODO_tootLatestPosts
@jaandrle
Cron
Forked from sebdd/tootLatestPosts
jaandrle avatar
mastodon$sumStats
@jaandrle
Script
An interactive, runnable TypeScript val by jaandrle
triptych avatar
myspace
@triptych
HTTP
Forked from stevekrouse/myspace
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
Forked from jdan/myspace