[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/rocketapi-io/rocketapi-python/main/examples.py [Back]  [Original]

from rocketapi import InstagramAPI
from rocketapi.exceptions import NotFoundException, BadResponseException

api = InstagramAPI(token="put your token here")

# Get user info by username
username = "kanyewest"
try:
    user = api.get_user_info(username)
    print(user)
except NotFoundException:
    print(f"User {username} not found")
except BadResponseException:
    print(f"Can't get {username} info from API")

Web Proxy Viewer  |  New URL  |  Original Page