Skip to main content

@idiomark/adapter-mastodon

Mastodon adapter for Idiomark (Personality Compression Protocol). Extracts user personality data from Mastodon and the Fediverse including toots, replies, boosts, and favorites.

Features​

  • User Profile: Bio, fields, follower counts, verification status
  • Toots: Posts with content, media, and metadata
  • Boosts: Shared content showing interests
  • Favorites: Liked content showing preferences
  • Replies: Threaded conversations with context

Authentication​

Uses OAuth 2.0 Bearer token authentication.

import { MastodonAdapter } from '@idiomark/adapter-mastodon'

const adapter = new MastodonAdapter({
accessToken: 'your_access_token',
instance: 'mastodon.social', // or any Mastodon instance
username: 'optional_username'
})

await adapter.authenticate()

Rate Limits​

Mastodon rate limits vary by instance:

  • Typically 300 requests per 5 minutes
  • Headers: x-ratelimit-remaining, x-ratelimit-reset

The adapter automatically handles rate limiting with backoff.

Usage​

// Fetch all user data
const content = await adapter.fetchData({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31'),
includeReplies: true
})

// Extract raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText({ limit: 100 })

Data Types​

TypeDescription
profileUser profile with bio and fields
tootPosts with content, media, and engagement
favoriteLiked posts showing preferences
boostReblogged posts showing amplification

Fediverse Support​

This adapter works with any Mastodon-compatible instance:

  • mastodon.social
  • fosstodon.org
  • mastodon.online
  • And 1000+ more instances

API Documentation​

License​

MIT