Anurag Kumar
Created October 17, 2020 © MIT

Live Insta Following/Follower Counter

Now visualize Insta Following/Follower Counter using Arduino and Bolt and a live running python script.

IntermediateFull instructions provided4 hours1
Live Insta Following/Follower Counter

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
Arduino UNO
Arduino UNO
USB-A to B Cable
USB-A to B Cable
Sunfounder 16×2 Liquid Crystal Display
Texas Instruments I2C Serial Interface Adapter Module
Male/Male Jumper Wires
Male/Female Jumper Wires
Male/Female Jumper Wires

Software apps and online services

Arduino IDE
Arduino IDE
Bolt Cloud
Bolt IoT Bolt Cloud
Snappy Ubuntu Core
Snappy Ubuntu Core


Read more


Arduino and LCD display

Arduino and Bolt Board


Python Code

import requests
import json
import time
from boltiot import Bolt

bolt_api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"  # Replace the string with the API key 
device_id = "BOLTXXXXXX"    # Replace the string with your Bolt ID
insta_username = "anurag_3301" # Replace it with your Instagram Username 

mybolt = Bolt(bolt_api_key, device_id)      # Connecting to the cloud using the API key and Bolt ID
response = mybolt.serialBegin('9600')       # Establishing UART Communication with 9600 baud rate
print(response)     # Printing the response for troubleshooting 

# This function takes the Insta Username as argument and returns a dictionary with following and follower count
def get_insta_count(username):
    url = '' + username + "/?__a=1"   # creating the url for request
    r = requests.get(url)       # request for data for the username 
    data = json.loads(r.text)   # loading the data as JSON
    # now return in form of a dictionary 
    return {"followers":data["graphql"]["user"]["edge_followed_by"]["count"] , "following": data["graphql"]["user"]["edge_follow"]["count"]}

while True:
    data = get_insta_count(insta_username) # calling the get_insta_count function for data
    followers = str(data["followers"])  # extrating the followers count
    following = str(data["following"])  # extrating the following count
    send = followers + "$" + following  # creating a string with followers and following count seperated by '$'
    response = mybolt.serialWrite(send) # Sending the data to arduino though UART line
    print(response)     # response for troubleshooting
    time.sleep(60)      # updating every minute 

Arduino code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 16, 2);

void setup(){

void loop(){
    String inString = "";
    String val[2] = {"", ""};
    if (Serial.available() > 0){
        inString = Serial.readString();
        int index = 0;
        for (int i = 0; i < inString.length(); i++){
            if (inString[i] == '$'){
                index = 1;
            val[index] += inString[i];
        lcd.setCursor(0, 0);
        lcd.print("Followers " + val[0]);
        lcd.setCursor(0, 1);
        lcd.print("Following " + val[1]);


Anurag Kumar

Anurag Kumar

0 projects • 0 followers