n8n integration
Extract social content to JSON in n8n
Import the workflow, add your mamitsu Bearer credential, and run it with a public Instagram, TikTok, YouTube, or X URL. It uses n8n's built-in HTTP Request node, so there is no community node to install.
Download the n8n workflow JSON
The workflow starts manually and is inactive on import. It contains example inputs, but no API key or saved credential. Review the URL and prompt before you execute it.
Manual Trigger
→ Edit Fields (set URL, prompt, optional schema)
→ HTTP Request (POST /api/v1/extract)Configure once
Store your API key in an n8n credential
The Edit Fields node contains a JSON object with url, prompt, and schema. Change those values before execution. Remove the schema property when you want mamitsu to choose the output structure.
- If you do not have an API key yet, create one under Mamitsu → API keys.
- In n8n, open the imported HTTP Request node. Under Authentication, choose Generic Credential Type, then Bearer Auth, and create a credential.
- Paste the API key into the credential's Bearer Token field and save it. Do not prepend
Bearer; n8n adds that to the Authorization header. - Select the saved credential on the HTTP Request node. The workflow export does not contain a credential reference.
Keep the key in n8n credentials, not in Edit Fields, an HTTP header value, or the exported JSON.
POST https://usemamitsu.com/api/v1/extract
Authentication: Bearer Auth credential
Body: JSON from Edit FieldsRun it manually
Edit the sample inputs before the paid request
- Open the Edit Fields node. Replace the example URL with a public supported post and change the prompt to the information you need.
- Check the mamitsu API key has available credits. Each request that reaches the model can spend credits, including an extraction that fails.
- Select Execute workflow in the canvas. The HTTP Request node waits up to 120 seconds, above the API's 90-second processing timeout.
- Inspect the HTTP Request output. A successful response contains
data,source, andextraction_id.
Import into a new workflow or an empty canvas to avoid mixing the template with nodes already on another workflow.
Workflow menu → Import from File
Choose mamitsu-n8n-social-extraction.jsonUse the output
Pass the extracted object to your next node
The HTTP Request node returns the API response body directly. In later nodes, use $json.data for the extracted fields, $json.source for the provider and URL, and $json.extraction_id when tracing a request or reporting a problem.
Treat extracted values as data to review, not as verified facts. If a value will trigger an important decision or action, add a review step before that action.
{
"extraction_id": "ext_example",
"data": {
"dish": "Penne all'arrabbiata",
"ingredients": ["penne", "tomatoes", "garlic"]
},
"source": {
"provider": "instagram",
"url": "https://instagram.com/reel/C8pQ2mLtN4x"
}
}Choose the shape
Keep or remove the optional schema
The sample workflow includes a JSON Schema for a fixed recipe object. Edit the JSON in the Edit Fields node when you need different fields. To let mamitsu choose the JSON structure from your prompt, remove the schema property from that JSON.
The API rejects unsupported JSON Schema keywords. Check the API schema reference for supported keywords and size limits.
Before production
Estimate credits and use supported public URLs
Each extraction costs at least 1 credit: 1 credit per started minute of video, plus 1 credit per started group of three photos. For YouTube, the first five minutes cost 1 credit per started minute; each started five-minute block after that costs 1 credit. The full cost is charged when the model is reached, even if extraction fails. Failures before the model are free.
Use a public HTTPS URL from Instagram, TikTok, YouTube, or X. Private or removed posts, unsupported URLs, oversized media, and provider duration limits can prevent extraction. See the API reference for the current provider limits and credit details.
The template does not retry automatically. Check the error code and extraction_id before deciding whether to retry.
Troubleshooting
Read the API error in the node output
The HTTP Request node is configured to return JSON error responses as output, including non-2xx statuses. Check $json.error.code and $json.error.message. Common causes include unauthorized (check the selected credential), insufficient_credits, unsupported_url, url_source_inaccessible, and invalid_schema.
Include extraction_id when reporting a server-side problem. For the full error list, use the API error codes.
n8n's import and export guide explains workflow JSON imports. Its HTTP Request credentials guide covers Bearer Auth setup.