istewart
istewart

Reputation: 439

Python Instagram error user_search()

I just got my authentication credentials for Instagram and I've been trying to use the Python wrapper, but I can't get basic queries to work. For example, after loading my client ID, secret and access token:

api = InstagramAPI(client_id=client_id, client_secret=client_secret, access_token=access_token)
print('got api %s'%(api))
user_name = 'natgeo'
search_result = api.user_search(q=user_name)
print('username %s gets search result %s'%
      (user_name, search_result))

returns

username natgeo gets search result []

which shouldn't be the case, since natgeo is a valid Instagram account. However, searching for my username works fine for some reason. Any idea what I'm doing wrong?

Upvotes: 0

Views: 689

Answers (1)

wpercy
wpercy

Reputation: 10090

It's likely that you're in sandbox mode. This means that you can only access the first 20 items of your own profile. Move your app out of sandbox mode to have full access to the API.

Upvotes: 2

Related Questions