Overview
The Mastodon node (Resource: Status, Operation: Search) allows you to search for public statuses (posts) on a Mastodon instance using a query string. This is useful for monitoring keywords, hashtags, or mentions across the federated Mastodon network. Common scenarios include social media monitoring, sentiment analysis, or content aggregation workflows.
Example use cases:
- Track mentions of your brand or product on Mastodon.
- Aggregate posts containing specific hashtags for reporting.
- Monitor discussions around certain topics in real-time.
Properties
| Name | Type | Meaning |
|---|---|---|
| Mastodon URL | String | The base URL of the Mastodon instance to connect to (e.g., https://mastodon.example). Required to direct API requests to the correct server. |
| Search Text | String | The UTF-8, URL-encoded search query (max 500 characters). Supports operators for advanced searching. Used to filter statuses based on content. |
| Return All | Boolean | If enabled, returns all matching results; if disabled, limits the number of results returned according to the "Limit" property. |
| Limit | Number | Maximum number of results to return when "Return All" is false. Must be at least 1. |
Output
The node outputs an array of objects, each representing a Mastodon status (post) that matches the search criteria. Each object typically contains fields such as:
{
"id": "string",
"content": "string",
"created_at": "string",
"account": { /* user info */ },
"url": "string",
// ...other Mastodon status fields
}
- The exact structure follows the Mastodon API's status object format.
- No binary data is output by this operation.
Dependencies
- External Service: Requires access to a Mastodon instance via its public API.
- Credentials: Optionally supports OAuth2 credentials (
mastodonOAuth2Api) if authentication is needed for private or extended endpoints. - n8n Configuration: Ensure the Mastodon node is properly configured with the correct instance URL and, if necessary, valid credentials.
Troubleshooting
Common Issues:
- Invalid Mastodon URL: Ensure the URL points to a valid Mastodon instance.
- Query Too Complex/Long: The search query must not exceed 500 characters and should comply with Mastodon's complexity limits.
- No Results Returned: Check that the search text is correct and that there are matching statuses on the instance.
- Authentication Errors: If accessing protected resources, ensure credentials are set up correctly.
Error Messages:
- "Request failed with status code 401/403": Indicates missing or invalid credentials.
- "400 Bad Request": Likely due to malformed search queries or exceeding character limits.
- "ENOTFOUND" or similar: The provided Mastodon URL is incorrect or unreachable.