Instagram Given User_id, how do I find the username?

I have a list of thousands of instagram user identifiers. How can I get their Instagram names / descriptors?

thank

+11
source share
7 answers

You should use this Instagram API:

https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN

The response will contain the username, full name, biography, number of subscribers and other information.

But you must get your app approved on Instagram before you can access the API.

https://www.picodash.com, , .

+6

instagram, php: https://github.com/postaddictme/instagram-php-scraper

$instagram = Instagram::withCredentials('username', 'password', 'path/to/cache/');
$account = $instagram->getAccountById('193886659');
echo $account->getUsername();

:

https://www.instagram.com/query/?q=ig_user(3){id,username,external_url,full_name,profile_pic_url,biography,followed_by{count},follows{count},media{count},is_private,is_verified}

: URL- . POST. . , ,

+9

API /user/ AJAX:

https://i.instagram.com/api/v1/users/{user_id}/info/

{user_id} - , 6817966272.

(. user['username'] ):

https://i.instagram.com/api/v1/users/6817966272/info/

{
  "user": {
    "pk": 6817966272,
    "username": "myriaamaa",
    "full_name": "\u2661",
    "is_private": false,
    "profile_pic_url": "https://instagram.fcnx2-1.fna.fbcdn.net/vp/66486d198fc02046d04d7bc11e51e54a/5D913015/t51.2885-19/s150x150/61226760_298998544311382_2345929352031502336_n.jpg?_nc_ht=instagram.fcnx2-1.fna.fbcdn.net",
    "profile_pic_id": "2056076981860037983_6817966272",
    "is_verified": false,
    "has_anonymous_profile_picture": false,
    "media_count": 216,
    "follower_count": 4926,
    "following_count": 83,
    "following_tag_count": 0,
    "biography": "YOU. ARE. HOLY \ud83c\udf19",
    "external_url": "",
    "total_igtv_videos": 0,
    "total_ar_effects": 0,
    "usertags_count": 6,
    "is_favorite": false,
    "is_interest_account": true,
    "hd_profile_pic_versions": [
      {
        "width": 320,
        "height": 320,
        "url": "https://instagram.fcnx2-1.fna.fbcdn.net/vp/fafecdc76c82de85580c9c03d14b1aaa/5D9BD2E5/t51.2885-19/s320x320/61226760_298998544311382_2345929352031502336_n.jpg?_nc_ht=instagram.fcnx2-1.fna.fbcdn.net"
      },
      {
        "width": 640,
        "height": 640,
        "url": "https://instagram.fcnx2-1.fna.fbcdn.net/vp/0ec5339e3958c9c41414e5378fa2443c/5D7DD28A/t51.2885-19/s640x640/61226760_298998544311382_2345929352031502336_n.jpg?_nc_ht=instagram.fcnx2-1.fna.fbcdn.net"
      }
    ],
    "hd_profile_pic_url_info": {
      "url": "https://instagram.fcnx2-1.fna.fbcdn.net/vp/8b3859950f0bb8e1a4a8f65566992b78/5D9132EF/t51.2885-19/61226760_298998544311382_2345929352031502336_n.jpg?_nc_ht=instagram.fcnx2-1.fna.fbcdn.net",
      "width": 774,
      "height": 774
    },
    "mutual_followers_count": 0,
    "has_highlight_reels": true,
    "can_be_reported_as_fraud": false,
    "is_business": false,
    "account_type": 1,
    "is_call_to_action_enabled": null,
    "include_direct_blacklist_status": true,
    "is_potential_business": true,
    "is_bestie": false,
    "has_unseen_besties_media": false,
    "show_account_transparency_details": false,
    "auto_expand_chaining": false,
    "highlight_reshare_disabled": false
  },
  "status": "ok"
}

2019-10:

, Instagram.

, iphone instagram:

Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 Instagram 12.0.0.16.90 (iPhone9,4; iOS 10_3_3; en_US; en-US; scale=2.61; gamut=wide; 1080x1920)

- : https://developers.whatismybrowser.com/useragents/explore/software_name/instagram/1

# top 5:
Mozilla/5.0 (Linux; Android 8.1.0; motorola one Build/OPKS28.63-18-3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36 Instagram 72.0.0.21.98 Android (27/8.1.0; 320dpi; 720x1362; motorola; motorola one; deen_sprout; qcom; pt_BR; 132081645)  
Mozilla/5.0 (Linux; Android 7.0; Lenovo K33b36 Build/NRD90N; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 Instagram 41.0.0.13.92 Android (24/7.0; 480dpi; 1080x1920; LENOVO/Lenovo; Lenovo K33b36; K33b36; qcom; pt_BR; 103516666)  
Mozilla/5.0 (Linux; Android 5.0.1; LG-H342 Build/LRX21Y; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 Instagram 40.0.0.14.95 Android (21/5.0.1; 240dpi; 480x786; LGE/lge; LG-H342; c50ds; c50ds; pt_BR; 102221277)  
Mozilla/5.0 (Linux; Android 6.0.1; SM-G610M Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 Instagram 41.0.0.13.92 Android (23/6.0.1; 480dpi; 1080x1920; samsung; SM-G610M; on7xelte; samsungexynos7870; pt_BR; 103516666)  
Mozilla/5.0 (Linux; Android 8.0.0; SM-A520F Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36 Instagram 46.0.0.15.96 Android (26/8.0.0; 480dpi; 1080x1920; samsung; SM-A520F; a5y17lte; samsungexynos7880; pt_BR; 109556226)
+5

- Instagram API ( SandBox), API instagram , Python, Instagram username & .

API GraphQL Instagram - .

[+] - API Instagram (30/5/2019)

import json
import requests
import re
import hashlib


def usernameToUserId(user):
    r1 = requests.get('https://www.instagram.com/web/search/topsearch/?query=' + user, headers={
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0'}).text

    if json.loads(r1)['users'][0]['user']['username'] == user:
        return json.loads(r1)['users'][0]['user']['pk']


def useridToUsername(id):
    if str(id).isnumeric():
        r1 = requests.get('https://instagram.com/instagram/', headers={
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0', }).text
        rhx_gis = json.loads(re.compile('window._sharedData = ({.*?});', re.DOTALL).search(r1).group(1))['nonce']

        ppc = re.search(r'ProfilePageContainer.js/(.*?).js', r1).group(1)
        r2 = requests.get('https://www.instagram.com/static/bundles/es6/ProfilePageContainer.js/' + ppc + '.js').text
        query_hash = re.findall(r'{value:!0}\);const o=\"(.*?)\"', r2)[0]

        query_variable = '{"user_id":"' + str(id) + '","include_reel":true}'
        t = rhx_gis + ':' + query_variable
        x_instagram_gis = hashlib.md5(t.encode("utf-8")).hexdigest()

        header = {'X-Instagram-GIS': x_instagram_gis,
                  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0',
                  'X-Requested-With': 'XMLHttpRequest'}
        r3 = requests.get(
            'https://www.instagram.com/graphql/query/?query_hash=' + query_hash + '&variables=' + query_variable,
            headers=header).text

        username = json.loads(r3)['data']['user']['reel']['user']['username']
        return username


#print(useridToUsername("1234567890"))
#print(usernameToUserId("TheUserName"))

Github Link: https://github.com/Snbig/InstaTrack

+4

(, https://www.instagram.com/p/Bqfhjk_AMTq/) python:

import requests, re, json
from bs4 import BeautifulSoup
r = requests.get('https://www.instagram.com/p/Bqfhjk_AMTq/')
soup = BeautifulSoup(r.content, "lxml")
scripts = soup.find_all('script', type="text/javascript", text=re.compile('window._sharedData'))
stringified_json = scripts[0].get_text().replace('window._sharedData = ', '')[:-1]
print json.loads(stringified_json)['entry_data']['PostPage'][0]['graphql']['shortcode_media']['owner']['username']
+2

, API Instagram, , , , . , SO, , .

: , , , - 4K Stogram. URL- -, : https://www.instagram.com/p/Bjh4rbdHcCU/ - URL-, . , <title> .

, , , , , .

+1

Good afternoon guys, I need someone to write just the code for me .... inputbox & a Button ..... just find the name or phrase ... and return the 50 most suitable names from Instagram (and their names users) Can someone help ???? need php & node.js ... christian @vondru. com ;-)

0
source

All Articles