A JavaScript-based tool for exporting a list of Instagram followers to a text file. This tool runs in the browser console and demonstrates interaction with Instagram's GraphQL API.
- Export followers from any public Instagram account
- Choose between two output formats:
- Username only (e.g.,
username
) - Full Instagram profile URL (e.g.,
https://www.instagram.com/username
)
- Username only (e.g.,
- Progress tracking during export
- Automatic file download
- Open your browser's developer tools (F12 or Right Click -> Inspect)
- Navigate to the Console tab
- Copy and paste the script below
- Type in the user
- Select the export format
- Press Enter to run
- User ID Lookup: First, the script queries Instagram's search API to convert the username to a user ID
- Follower Fetching: Uses Instagram's GraphQL API to fetch followers in batches of 50
- Pagination: Continues fetching until all followers are retrieved
- Export: Creates a text file with the results and triggers a download
- Uses the browser's built-in
fetch
API for requests - Implements pagination using GraphQL cursor-based pagination
- Handles the download using Blob and URL.createObjectURL
- Compatible with modern browsers (Chrome, Firefox, Safari, Edge)
- The script fetches followers in batches of 50 to minimize API load
- Console logs provide progress updates during execution
- If rate limited, the script will throw an error which is caught and logged
The script includes basic error handling for:
- User not found
- Network errors
- API response errors
- Invalid JSON responses
- Requires user to be logged into Instagram in the browser
- Subject to Instagram's rate limiting
- May not work if Instagram changes their API structure
- Only exports usernames (not other user data)
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.