Actions7
Overview
The Instagram Private API node for n8n allows you to interact with Instagram using its private (unofficial) API. Specifically, the Get User Stories operation retrieves the current stories posted by a specified Instagram user, given their User ID. This is useful for automation scenarios such as:
- Monitoring competitor or influencer stories.
- Archiving or analyzing story content for social media analytics.
- Triggering workflows based on new story posts.
Example use case:
Automatically download and analyze the latest stories from a list of users every morning.
Properties
| Display Name | Type | Description |
|---|---|---|
| User ID | String | User ID to get information for (required). |
Output
The output is an array of JSON objects, each containing:
- success (
boolean): Indicates if the operation was successful. - userId (
string): The User ID for which stories were fetched. - sessionData (
object): Session data used for authentication (can be ignored unless session management is needed). - userStories (
array): An array of story items retrieved from the user's account. Each item represents a single story post and contains various fields as returned by the Instagram API (such as media URLs, timestamps, etc.).
Example output:
[
{
"success": true,
"userId": "123456789",
"sessionData": { /* ... */ },
"userStories": [
{
// Story object as returned by Instagram API
"id": "987654321",
"media_type": 1,
"image_versions2": { /* ... */ },
"taken_at": 1712345678,
// ... other fields
},
// ... more stories
]
}
]
Dependencies
- External Service: Instagram account (username & password required).
- API Key/Credentials: n8n credential type
instagramPrivateApiwith username, password, and optionally session data. - Node.js Modules: Uses
instagram-private-api,fs,path, andos. - n8n Configuration: No special configuration required, but persistent storage for session files is recommended for stable operation.
Troubleshooting
Common Issues:
Invalid or missing User ID:
- Error:
"User ID is required"
Ensure you provide a valid User ID.
- Error:
Authentication errors:
- Error:
"Failed to authenticate with Instagram. Please check your credentials."
Double-check your Instagram username and password in the credentials.
- Error:
Session issues:
- If session data is invalid or expired, the node will attempt to re-authenticate. If this fails, update your credentials.
Checkpoint or login required:
- Error:
"Checkpoint required. Please verify your account."
Instagram may require additional verification (e.g., via email/SMS). Complete verification in the Instagram app.
- Error:
User not found:
- Error:
"User ID is required"or no stories returned.
Make sure the User ID exists and is correct.
- Error: