Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 2.79 KB

File metadata and controls

103 lines (74 loc) · 2.79 KB

App Store Data API — JavaScript (apify-client) examples

Call the hosted Actor logiover/app-store-data-api from Node.js with the official apify-client.

Install

npm install apify-client

Search apps by keyword

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('logiover/app-store-data-api').call({
  mode: 'search',
  query: 'meditation',
  country: 'us',
  maxResults: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} apps`);
console.log(items[0]);

Enrich a list of bundle IDs with full app details

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('logiover/app-store-data-api').call({
  mode: 'app',
  appIds: ['com.spotify.client', 'com.google.ios.youtube'],
  country: 'us',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const app of items) {
  console.log(`${app.title}${app.score}★ (${app.reviews} reviews)`);
}

Pull the newest reviews for an app

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('logiover/app-store-data-api').call({
  mode: 'reviews',
  id: 324684580,
  country: 'us',
  reviewSort: 'RECENT',
  maxResults: 500,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const oneStar = items.filter((r) => r.score === 1);
console.log(`${oneStar.length} one-star reviews out of ${items.length}`);

ASO: combine ranked search + autocomplete suggestions

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const actor = client.actor('logiover/app-store-data-api');

const suggest = await actor.call({ mode: 'suggest', query: 'budget', country: 'us' });
const { items: keywords } = await client.dataset(suggest.defaultDatasetId).listItems();

console.log('Long-tail ASO keywords:');
keywords.forEach((k) => console.log(`  #${k.position}  ${k.term}`));

Top charts by country

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('logiover/app-store-data-api').call({
  mode: 'list',
  collection: 'TOP_FREE_IOS',
  category: 'GAMES',
  country: 'jp',
  maxResults: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.table(items.map((a, i) => ({ rank: i + 1, title: a.title, dev: a.developer })));

See also: cli.md · api-curl.md · python.md