@efffrida/gplayapi

中文文档
0.0.43发布于 2026/11/13GPL-3.0-onlyES Module构建来源已验证近 30 天下载 2471

Google Play API client for downloading apps

原始使用文档

@efffrida/gplayapi

Unofficial Google Play Store API for downloading APKs directly from the Google Play Store.

The store's protobuf endpoints are exposed as effects: details and bulkDetails for app metadata, purchase and delivery for acquiring a download token, and downloadToStreams and downloadToDisk for pulling down the APK along with its splits and expansion files.

Example usage

import { Effect, Layer } from "effect";

import { NodeHttpClient, NodeServices } from "@effect/platform-node";
import { AndroidDevice, GooglePlayApi, PlayAccount } from "@efffrida/gplayapi";

const PlayLive = Layer.mergeAll(
    AndroidDevice.layerEmbeddedPixel7a,
    NodeHttpClient.layerUndici,
    PlayAccount.layerConfig()
).pipe(Layer.provideMerge(NodeServices.layer));

const program = Effect.gen(function* () {
    const { item } = yield* GooglePlayApi.details("com.nimblebit.tinytower");
    yield* Effect.log(`${item?.title} ${item?.details?.appDetails?.versionString}`);

    const files = yield* GooglePlayApi.downloadToDisk("com.nimblebit.tinytower");
    // ...
}).pipe(Effect.scoped, Effect.provide(PlayLive));

Services

Three things have to be provided.

A device, which decides the hardware fingerprint the store sees, and therefore which builds it will offer. AndroidDevice.layerEmbeddedPixel7a ships with the package; other devices can be built from an Aurora store style properties file with AndroidDevice.fromPropertiesFile.

An HttpClient, from whichever platform package suits the runtime.

A PlayAccount, which decides how google play credentials are obtained. There is no default, so pick one of:

  • layerAuroraDispenser(url?) hands out anonymous credentials from an Aurora store compatible dispenser, https://auroraoss.com/api/auth by default. The hosted one blocks and rate limits datacenter ip ranges, so it is a poor fit for anything running on cloud infrastructure.
  • layerConfig({token?}) reads credentials that were obtained out of band from the config provider, defaulting to the GPLAY_AUTH_TOKEN environment variable.
  • layerStatic(credentials) serves credentials that are already in hand.

The device derives auth headers from itself and the account once, then caches them for 30 minutes. A 401 or a 403 from the store evicts them early, so the next call acquires a fresh set. Transport failures, timeouts and 408, 429, 500, 502, 503 and 504 responses are retried with backoff.

downloadToDisk writes each file to a scoped temporary file and checks its integrity while it streams, so the files are deleted when the surrounding Scope closes. Copy or move them elsewhere before then if they need to outlive it.

版本与发布记录

@efffrida/gplayapi 共发布 42 个版本,首次发布于 2025/11/18;过去 12 个月发布了 42 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.43latest2026/11/131 天前
0.0.422026/11/112 天前
0.0.412026/11/094 天前
0.0.402026/11/0211 天前
0.0.392026/11/0211 天前
0.0.382026/10/3114 天前

关于 @efffrida/gplayapi 的常见问题

@efffrida/gplayapi 是什么?

Google Play API client for downloading apps

如何安装 @efffrida/gplayapi?

在项目目录运行 npm install @efffrida/gplayapi,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:effect(4.1.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@efffrida/gplayapi 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/efffrida__gplayapi 是否存在。

@efffrida/gplayapi 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@efffrida/gplayapi 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@efffrida/gplayapi 可以商用吗?

@efffrida/gplayapi 使用 GPL-3.0-only 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@efffrida/gplayapi 的下载量有多少?

根据 npm 官方下载统计,@efffrida/gplayapi 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,471 次,日均约 82 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@efffrida/gplayapi 还在维护吗?

最新版本 0.0.43 发布于 2026/11/13(1 天前);至今共发布 42 个版本,其中过去 12 个月发布了 42 个;首次发布于 2025/11/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。