Matrix Message Scraper avatar

Matrix Message Scraper

Pricing

Pay per event

Go to Apify Store
Matrix Message Scraper

Matrix Message Scraper

Scrape public rooms and messages from any Matrix homeserver (matrix.org, Element, or self-hosted). Discover public rooms by keyword or scrape message history from specific rooms using a Matrix access token.

Pricing

Pay per event

Rating

0.0

(0)

Developer

BowTiedRaccoon

BowTiedRaccoon

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

1

Monthly active users

11 days ago

Last modified

Share

Matrix Chat Scraper — Rooms & Message History

Extract public room listings and message history from any Matrix homeserver, including matrix.org. Operates in two modes: discover public rooms without authentication, or retrieve full message history from specific rooms using an access token. Returns structured JSON with room metadata, message content, reply threads, and media references.

What does the Matrix Chat Scraper do?

  • Discover mode — Lists public rooms on any Matrix homeserver without login; returns room name, topic, member count, join rules, and encryption status
  • Scrape mode — Retrieves message history from one or more rooms using a Matrix access token; returns messages, replies, edits, thread IDs, and media URLs
  • Supports optional search filtering to narrow public room discovery by keyword
  • Works with any Matrix homeserver (matrix.org, mozilla.org, self-hosted, etc.)
  • Returns two record types in the same dataset: room and message

What data does it extract?

Room records (record_type: room)

FieldDescription
record_typeroom
room_idMatrix room ID (e.g. !abc123:matrix.org)
room_nameDisplay name of the room
room_topicRoom topic or description
room_canonical_aliasCanonical alias (e.g. #roomname:matrix.org)
room_member_countCurrent member count
room_is_encryptedWhether the room uses end-to-end encryption
room_join_ruleJoin rule: public, invite, knock, etc.
room_world_readableWhether history is visible without joining
room_guest_can_joinWhether guests can join
room_avatar_urlRoom avatar MXC URL
room_typeMatrix room type if set
homeserverHomeserver domain

Message records (record_type: message)

FieldDescription
record_typemessage
event_idUnique Matrix event ID
event_typeMatrix event type (e.g. m.room.message)
event_senderSender MXID (e.g. @user:matrix.org)
event_sender_display_nameDisplay name of the sender
event_origin_server_tsServer timestamp (milliseconds since epoch)
event_content_msgtypeMessage type (m.text, m.image, m.file, etc.)
event_content_bodyPlain text message body
event_content_formatted_bodyHTML-formatted body where available
event_content_urlMXC URL for media messages
event_reply_toEvent ID of the message being replied to
event_thread_idThread root event ID if part of a thread
event_editsArray of edit event IDs for this message
event_room_idRoom ID this message belongs to

How to use it

Choose action: discover_rooms requires only a homeserver URL. scrape_room_messages requires an access token and at least one room ID. Access tokens do not expire by default on most homeservers but can be revoked via Element settings if needed.

FieldTypeDefaultDescription
actionstringdiscover_roomsdiscover_rooms or scrape_room_messages
homeserverstringhttps://matrix.orgMatrix homeserver URL
accessTokenstringMatrix access token (required for scrape_room_messages). Secret field.
roomIdsarrayList of room IDs to scrape (e.g. !abc123:matrix.org)
searchTermstringKeyword filter for room discovery
maxItemsinteger10Maximum records to return
maxMessagesPerRoominteger100Maximum messages to retrieve per room
messageDirectionstringbPagination direction: b (backwards from latest) or f (forwards from oldest)

Use cases

  • Open-source community analysis — matrix.org alone hosts 100,000+ public rooms covering tech projects, gaming communities, and decentralized apps; map community size and topic distribution at scale.
  • Academic linguistics research — Collect multilingual message corpora from Matrix federated servers for NLP training, sentiment analysis, or comparative linguistics studies.
  • Content moderation tooling — Discover public rooms matching specific keywords and monitor message content for policy-violating material across open Matrix communities.
  • Competitive intelligence — Track discussion volumes and sentiment in technology or gaming community rooms without requiring a login to join.
  • Archival and research — Preserve message history from public rooms using the messageDirection: f mode to paginate from the earliest available messages forward.

FAQ

How do I get a Matrix access token? Log in to your Matrix client (e.g. Element), go to Settings > Help & About > Advanced, and copy the Access Token shown there. The token authenticates as your account on the homeserver you specify.

Does the actor decrypt end-to-end encrypted messages? No. The actor retrieves events from the Matrix Client-Server API. Encrypted rooms return encrypted event payloads — the decryption keys are not accessible via the API without a full E2E key export. Use discover_rooms to identify whether a room is encrypted (room_is_encrypted: true) before attempting to scrape it.

Can I scrape messages from a private room? Yes, provided your access token is for an account that is already a member of that room. The roomIds input accepts any room ID your account can read.

Results are available for export in JSON, CSV, and Excel formats from the Apify dataset tab.