ApifyAPIError: Input is not valid: Field input.usernames is required
I am trying to fetch profile data from a csv list and i have defined a row as the input for the second actor. The row contains already scrapped usernames of some Instagram accounts.
I have initialized the client as Apifyclient(API) and and defined some fields that i want to extract from the data i scrape from this actor.
The problem lies in run_input, as i have a list called usernames which contains usernames for the accounts/profiles i want to scrape. Upon implementing a loop to go through the list, i am receiving an error which says the following:
Error:
ApifyApiError Traceback (most recent call last)
<ipython-input-15-01327b9fcd64> in <cell line: 30>()
37
38 # Run the Actor and wait for it to finish
---> 39 run = client.actor("dSCLg0C3YEZ83HzYX").call(run_input=run_input)
40
41 # Prepare the CSV file to store the scraped data
6 frames
/usr/local/lib/python3.10/dist-packages/apify_client/_http_client.py in _make_request(stop_retrying, attempt)
189 logger.debug('Status code is not retryable', extra={'status_code': response.status_code})
190 stop_retrying()
--> 191 raise ApifyApiError(response, attempt)
192
193 return retry_with_exp_backoff(
ApifyApiError: Input is not valid: Field input.usernames is required.
i have tried a few things on my own but still stuck. Can anyone help?
language is python and working on google colab for now
4 Replies
equal-aquaOP•14mo ago
@Helper anyone??
hi. it seems the usernames is missing
equal-aquaOP•14mo ago
usernames is a list which contains data in form of json. The value is passed till the run command comes.
make sure run_input is an object. eg:
run_input = {'usernames': 'some_name'}
or run_input = {'usernames': the_list}