Get all the comments from an Instagram post and place them into a CSV file. Helpful for influencers running a social media contest and need an automated way to copy all the comments.
Instagram's API restricts it's use to only registered and verified applications and is difficult to get public data. By making HTTP requests to their GraphQL endpoint, data can be easily pulled and transformed to be made useful.
To run locally, clone the project:
git clone https://github.com/kelvilee/IGCommentPicker.git
cd IGCommentPicker
Instagram requires a query_hash query parameter in order to make GraphQL requests.
-
Go to https://www.instagram.com/github/ and open the inspector
F12 -
You should see a
?query_hash=...request being sent. Click on it and select theHeaderstab. Scroll down to the bottom and underQuery String Parametersis your query_hash
Create a .env.local file in the root directory of the project and add the QUERY_HASH variable to the file using your query_hash
Example:
QUERY_HASH=15bf78a4ad24e33cbd838fdb41353ac1
Install dependencies with yarn and run the local development server
yarn
yarn dev
Enjoy!

