app-store-scraper

repository·master·Indexed 23 days ago

https://github.com/facundoolano/app-store-scraper

A Node.js module for scraping application data from the iTunes/Mac App Store. It provides methods to retrieve full application details, list apps from collections, search for apps, fetch developer information, and access app reviews, ratings, privacy details, and version history. Version 0.18.0 includes a memoized() method for caching results to reduce redundant network requests.

Tokens
3.9K
Snippets
9
Records
25
Agent score
80%

What's inside app-store-scraper

  1. Enable memoization for caching results

    master

    To avoid redundant network requests to the iTunes API, you can use the memoized() method. This returns a version of the store that caches results using the memoizee module.

    Default Behavior:

    • Caches up to 1000 values per method.
    • Values expire after 5 minutes.

    Custom Configuration: You can pass options to memoized() that are supported by memoizee (e.g., maxAge).

  2. Retrieve full application details with fullDetail

    master

    By default, list() returns a lightweight version of the application data. If you require more comprehensive information for each application, set the fullDetail option to true.

    When fullDetail is enabled, the library performs an additional lookup for every application ID found in the initial collection request. It is recommended to provide a throttle value in requestOptions to avoid hitting rate limits during these additional requests.

  3. Retrieve app ratings with ratings()

    master

    Use the ratings() method to retrieve the rating count and histogram for an application.

    Options:

    • id: The iTunes "trackId" of the app.
    • appId: The iTunes "bundleId" of the app.
    • country: Two-letter country code. Defaults to us.
    var store = require('app-store-scraper');
    
    store.ratings({
      appId: 'com.midasplayer.apps.candycrushsaga',
    })
    .then(console.log)
    .catch(console.log);
  4. Search for applications with search()

    master

    Use the search() method to find applications based on a search term.

    Options:

    • term: The search query (required).
    • num: Number of elements to retrieve. Defaults to 50.
    • page: The page of results to retrieve. Defaults to 1.
    • country: Two-letter country code. Defaults to us.
    • lang: Language code for result text. Defaults to en-us.
    • idsOnly: Boolean. If true, skips extra lookup requests and returns only an array of application IDs.
    var store = require('app-store-scraper');
    
    store.search({
      term: 'panda',
      num: 2,
      page: 3,
      country : 'us',
      lang: 'lang'
    })
    .then(console.log)
    .catch(console.log);
  5. Retrieve app reviews with reviews()

    master

    Use the reviews() method to retrieve a page of reviews for a specific application.

    Options:

    • id: The iTunes "trackId" of the app.
    • appId: The iTunes "bundleId" of the app.
    • country: Two-letter country code. Defaults to us.
    • page: The review page number to retrieve. Defaults to 1, maximum is 10.
    • sort: The review sort order. Defaults to store.sort.RECENT. Available options are store.sort.RECENT and store.sort.HELPFUL.
    var store = require('app-store-scraper');
    
    store.reviews({
      appId: 'com.midasplayer.apps.candycrushsaga',
      sort: store.sort.HELPFUL,
      page: 2
    })
    .then(console.log)
    .catch(console.log);
  6. Get app privacy details with privacy()

    master

    Use the privacy() method to retrieve privacy details for an application. Note: This is currently only supported for the US App Store.

    Options:

    • id: The iTunes "trackId" of the app.
    var store = require('app-store-scraper');
    
    store.privacy({
      id: 324684580,
    })
    .then(console.log)
    .catch(console.log);
  7. Retrieve application lists with list()

    master

    Use the list() method to retrieve a list of applications from specific iTunes collections.

    Options:

    • collection: The collection to look up (e.g., store.collection.TOP_FREE_IPAD).
    • category: The genre category ID (e.g., store.category.GAMES_ACTION).
    • country: Two-letter country code. Defaults to us.
    • lang: Language code for result text. Defaults to undefined.
    • num: Number of elements to retrieve. Defaults to 50, maximum is 200.
    • fullDetail: Boolean. If true, performs extra requests to fetch full attributes for each app (similar to the app() method).
    var store = require('app-store-scraper');
    
    store.list({
      collection: store.collection.TOP_FREE_IPAD,
      category: store.category.GAMES_ACTION,
      num: 2
    })
    .then(console.log)
    .catch(console.log);
  8. Retrieve full application details with app()

    master

    Use the app() method to get comprehensive details for a specific application. You must provide either the id (iTunes trackId) or the appId (iTunes bundleId).

    Options:

    • id: The iTunes "trackId" (e.g., 553834731).
    • appId: The iTunes "bundleId" (e.g., com.midasplayer.apps.candycrushsaga).
    • country: Two-letter country code. Defaults to us. Affects data language.
    • lang: Language code for result text. Defaults to undefined (uses country default).
    • ratings: Boolean. If true, loads additional ratings information including the total count and the histogram.
    var store = require('app-store-scraper');
    
    // Basic usage
    store.app({id: 553834731}).then(console.log).catch(console.log);
    
    // Usage with ratings enabled
    store.app({id: 553834731, ratings: true}).then(console.log).catch(console.log);
  9. Get version history with versionHistory()

    master

    Use the versionHistory() method to retrieve the version history for an application.

    Options:

    • id: The iTunes "trackId" of the app.
    var store = require('app-store-scraper');
    
    store.versionHistory({
      id: 324684580,
    })
    .then(console.log)
    .catch(console.log);