Issues
Fatalunhandled#a13f9c2e

Error

Upstream API 402 Payment Required: account credits exhausted

src/fetchProfiles.ts › ensureOk · instagram-scraper

Events
1.3K
Users
38
First seen
May 31
Last seen
2m ago

Tags

actorseemuapps/instagram-scraperbuild0.4.12originSCHEDULERrelease0.4.12

Input

actor run input
{
  "usernames": [
    "nasa",
    "natgeo",
    "spacex"
  ],
  "resultsLimit": 500,
  "scrapeFollowers": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "apiKey": "<encrypted>"
}

Stack trace

most recent call first
ensureOksrc/fetchProfiles.ts:57in app
52async function ensureOk(response: Response): Promise<Response> {
53 if (response.ok) return response;
54
55 const body = await response.json().catch(() => null);
56 const detail = body?.message ?? response.statusText;
57 throw new Error(`Upstream API ${response.status} ${detail}`);
58}
59
60export async function fetchFollowersPage(
61 username: string,
62 cursor?: string,
fetchFollowersPagesrc/fetchProfiles.ts:31in app
26 const url = new URL('/v2/user/followers', API_BASE_URL);
27 url.searchParams.set('username', username);
28 if (cursor) url.searchParams.set('cursor', cursor);
29
30 const response = await fetch(url, { headers: authHeaders });
31 await ensureOk(response);
32
33 return (await response.json()) as FollowersPage;
34}
mainsrc/main.ts:44in app
39for (const username of input.usernames) {
40 let cursor: string | undefined;
41
42 do {
43 logger.info(`Fetching followers for @${username}`);
44 const page = await fetchFollowersPage(username, cursor);
45 await Dataset.pushData(page.followers);
46 cursor = page.nextCursor;
47 } while (cursor);
48}

Breadcrumbs

leading up to the error
  • httpGET /v2/user/followers → 4020s
  • httpGET /v2/user/followers → 4022s
  • httpGET /v2/user/by/username → 2005s
  • apifyActor.main started (input: 1 username)8s