title: Get instagram full profile information without "Instagram Graph Api"
body: <p>I wanna get some data from the Instagram users.</p>
  <p>So I've used <strong>Instagram Basic Display Api</strong> and the profile data I could receive was these:</p>
  <ul>
  <li>username</li>
  <li>media count</li>
  <li>account type</li>
  </ul>
  <p>but I want these data:</p>
  <ul>
  <li>username</li>
  <li>name</li>
  <li>media count</li>
  <li>Profile Image</li>
  <li>followers count</li>
  <li>following count</li>
  </ul>
  <p>I don't know how can I have these data without <strong>Instagram Graph API</strong>(in any way) in c#?</p>
  <p>Or is there any way to get these data with the <code>WebClient</code> class or anything like that?</p>
  <p><strong>Update for @Eehab answer:</strong> I use <code>RestClient</code> and <code>WebClient</code> in this example and both of them give the same result.</p>
  <p>Now see <code>WebClient</code> example:</p>
  <pre><code>WebClient client = new WebClient();
  string page = client.DownloadString(&quot;https://www.instagram.com/instagram/?__a=1&quot;);
  Console.WriteLine(page);
  Console.ReadKey();
  </code></pre>
  <p>and see an image of this code <a href="https://imgur.com/a/Yj7Ssb5" rel="nofollow noreferrer">here</a>.</p>
  <p>now see the result of the code above <a href="https://file.io/cYXwfuXLU6LL" rel="nofollow noreferrer">here</a></p>
  <p>I've also got, that this <a href="https://www.instagram.com/instagram/?__a=1" rel="nofollow noreferrer">link</a> is the only access for login users and I've been login into my Instagram account in chrome already, but I think <code>WebClient</code> needs to log in too.</p>
  <h2><strong>Edit Through @Eehab answer:</strong></h2>
  <p>In this case for using this Url(<a href="https://www.instagram.com/%7Busername%7D/?__a=1" rel="nofollow noreferrer">https://www.instagram.com/{username}/?__a=1</a>), we can't do it without Instagram logged-in browser profile. So we should log in to Instagram with selenium and use the logged-in cookies to use it for Url requests. So first Install the selenium web driver and then write the following codes(untested):</p>
  <pre><code>var driver = new ChromeDriver();
  
  //go to Instagram
  driver.Url = &quot;https://www.instagram.com/&quot;;
  
  //Log in
  var userNameElement = _driver.FindElement(By.Name(&quot;username&quot;));
  userNameElement.SendKeys(&quot;Username&quot;);
  var passwordElement = _driver.FindElement(By.Name(&quot;password&quot;));
  passwordElement.SendKeys(Cars[0].auth.pass);
  var loginButton = _driver.FindElement(By.Id(&quot;login&quot;));
  loginButton.Click();
  
  //Get cookies
  var cookies = driver.Manage().Cookies.AllCookies.ToList();
  
  //Send request with given cookies :)
  var url = &quot;https://www.instagram.com/{username}/?__a=1&quot;;
  var httpRequest = (HttpWebRequest)WebRequest.Create(url);
  foreach(var cookie in cookies){
     httpRequest.Headers[&quot;Cookie&quot;] += $&quot;{cookie.Name}={cookie.Value}; &quot;;
  }
  var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
  using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
  {
     var result = streamReader.ReadToEnd();
  }
  //...
  </code></pre>
  <p>If anyone can improve this question for more uses can edit and I really appreciate it :)</p>