Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-store-client

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-store-client

A TypeScript client for the Apple App Store API

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
0
Weekly downloads
 
Created
Source

App Store Client

What is this?

This library is a TypeScript library for retrieving public data from the App Store. For example, you can get app details, ratings, reviews, similar apps, and privacy information of other apps.

Note that it is different from App Connect API, which focuses on providing API about your app, such as app sales, ratings, reviews, etc.

Motivation

This library is inspired by the app-store-scraper project, which I really appreciate. However, due to recent maintenance issues with the original library, I decided to create this TypeScript version. It includes some breaking changes to enhance TypeScript compatibility and resolve various bugs.

Features

  • 🚀 Full TypeScript support
  • 🔄 Built-in request caching
  • 🛠 Customizable options
  • 📊 Comprehensive API coverage
  • 🧪 Well-tested codebase

Installation

NPM

npm install app-store-client

Yarn

yarn add app-store-client

Usage

First, import and instantiate the AppStoreClient:

import { AppStoreClient, Collection } from "app-store-client";

const client = new AppStoreClient();

Get App Details

You can get app details by ID or bundle ID.

// Use ID
const appData = await client.app({ id: "6446901002" });

// Or use app ID (bundle ID)
const appData = await client.app({ appId: "com.burbn.barcelona" });

Get Apps by Developer

You can get apps by developer ID.

// Use developer ID
const apps = await client.appsByDeveloper({ devId: "389801255" });

List Apps

You can list apps by collection name. Please see the Collection enum for available collections.

// Use collection name
const topFreeApps = await client.list({
  collection: Collection.TOP_FREE_IOS,
  num: 5,
});

Get Privacy Details

You can get privacy details by ID. You must provide the ID.

const privacy = await client.privacy({ id: "6446901002" });

Get Ratings

You can get ratings by ID. You must provide the ID.

const ratings = await client.ratings({ id: "6446901002" });

Get Reviews

You can get reviews by ID or app ID (bundle ID). You must provide either ID or app ID.

// Use ID
const reviews = await client.reviews({ id: "6446901002" });

// Or use app ID (bundle ID)
const reviews = await client.reviews({ appId: "com.burbn.barcelona" });

Search Apps

You can search apps by keyword.

const searchResults = await client.search({ term: "chatgpt", num: 5 });

Get Similar Apps

You can get similar apps by ID or app ID (bundle ID). You must provide either ID or app ID.

// Use ID
const similarApps = await client.similarApps({ id: "6446901002" });

// Or use app ID (bundle ID)
const similarApps = await client.similarApps({ appId: "com.burbn.barcelona" });

Get Suggested Search Terms

You can get suggested search terms by keyword.

const suggestions = await client.suggestedTerms({ term: "threads" });

Caching

The client includes built-in request caching. You can customize the cache max age when instantiating the client:

const client = new AppStoreClient({ cacheMaxAge: 1000 * 60 * 5 }); // 5 minutes

This helps reduce unnecessary API calls and improve performance for repeated requests. If the request body or parameters are different, it will be treated as a different request.

The default cache max age is 5 minutes and up to 1000 requests.

Custom Request Options

export interface AppStoreClientOptions {
  country?: Country;
  language?: string;
  requestOptions?: any;
  throttle?: number;
  cacheMaxAge?: number;
  cacheMaxSize?: number;
}
  • country: The country to use. Defaults to US.
  • language: The language to use. Defaults to en-us.
  • requestOptions: The request options to use.
  • throttle: The throttle to use. Defaults to undefined.
  • cacheMaxAge: The cache max age. Defaults to 1000 * 60 * 5 ms (5 minutes).
  • cacheMaxSize: The cache max size. Defaults to 1000.

License

This project is licensed under the MIT License. See the LICENSE file for details.

FAQs

Package last updated on 21 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc