Skip to content

Instantly share code, notes, and snippets.

@NISH1001
Created April 9, 2018 16:52
Show Gist options
  • Save NISH1001/e01bb9e02925b97aa0d37309e515262c to your computer and use it in GitHub Desktop.
Save NISH1001/e01bb9e02925b97aa0d37309e515262c to your computer and use it in GitHub Desktop.
A naive script to check if a username is available in Instagram
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
def check_user(username):
url = "https://www.instagram.com/{}".format(username)
response = requests.get(url)
status_code = response.status_code
return True if status_code == 200 else False
def main():
print(check_user('nishparadox'))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment