{"id":13438248,"url":"https://github.com/dweinstein/node-google-play","last_synced_at":"2025-03-19T18:32:33.482Z","repository":{"id":22543529,"uuid":"25884434","full_name":"dweinstein/node-google-play","owner":"dweinstein","description":"Get details and download apps from https://play.google.com by emulating an Android (Nexus 5X) device by default. For a rust version of this library check out https://github.com/dweinstein/rs-google-play","archived":true,"fork":false,"pushed_at":"2021-05-06T19:05:41.000Z","size":542,"stargazers_count":267,"open_issues_count":17,"forks_count":84,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-24T03:23:07.956Z","etag":null,"topics":["android","apk","download","google","metadata","nodejs","play-store"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dweinstein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-28T18:40:02.000Z","updated_at":"2024-04-10T16:16:21.000Z","dependencies_parsed_at":"2022-08-25T20:40:45.941Z","dependency_job_id":null,"html_url":"https://github.com/dweinstein/node-google-play","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Fnode-google-play","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Fnode-google-play/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Fnode-google-play/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweinstein%2Fnode-google-play/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dweinstein","download_url":"https://codeload.github.com/dweinstein/node-google-play/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221729828,"owners_count":16871119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","apk","download","google","metadata","nodejs","play-store"],"created_at":"2024-07-31T03:01:03.990Z","updated_at":"2025-03-19T18:32:33.475Z","avatar_url":"https://github.com/dweinstein.png","language":"JavaScript","readme":"[![NPM](https://nodei.co/npm/gpapi.png?downloads=true)](https://nodei.co/npm/gpapi/)\n\n[![Build Status](https://travis-ci.org/dweinstein/node-google-play.svg?branch=master)](https://travis-ci.org/dweinstein/node-google-play)\n[![npm](https://img.shields.io/npm/dm/gpapi.svg)](https://www.npmjs.com/package/gpapi)\n\nFor a rust version of this library check out [rs-gpapi](https://github.com/dweinstein/rs-google-play).\n\n# SYNOPSIS\n\nCall Google Play APIs from Node. You might want to check out the [CLI](https://github.com/dweinstein/node-google-play-cli) package as well.\n\nBy default behaves like a Nexus device with SDK 23 for app downloads.\n\n# USAGE\n\n```javascript\nvar api = require('gpapi').GooglePlayAPI({\n  username: user,\n  password: pass,\n  androidId: android_id\n  // apiUserAgent: optional API agent override (see below)\n  // downloadUserAgent: optional download agent override (see below)\n});\n\n// usage via Promise\napi.details(\"com.viber.voip\").then(console.log);\n\n// usage via node callback convention\napi.details(\"com.viber.voip\", function (err, res) {\n  console.log(err ? err : res);\n});\n```\n\n# Options\n\nThe options accepted:\n\n```js\n{\n  username: username,\n  password: password,\n  androidId: androidId,\n  countryCode: 'us',\n  language: 'en_US',\n  requestsDefaultParams: requestsDefaultParams,\n  apiUserAgent: USER_AGENT,\n  downloadUserAgent: DOWNLOAD_MANAGER_USER_AGENT,\n  useCache:true,\n  debug: false\n}\n```\n\n## Defaults\n\nThe default `apiUserAgent` and `downloadUserAgent` is from  Nexus 5X device, w/\nPlay Store version 6.8.44:\n\ne.g.,:\n```\nconst USER_AGENT = (\n    'Android-Finsky/6.8.44.F-all%20%5B0%5D%203087104 ' +\n    '(api=3,versionCode=80684400,sdk=23,device=bullhead,'+\n    'hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,'+\n    'model=Nexus%205X,buildId=MHC19Q,isWideScreen=0)'\n);\n\nconst DOWNLOAD_MANAGER_USER_AGENT = (\n  'AndroidDownloadManager/6.0.1 (Linux; U; Android 6.0.1; Nexus 5X Build/MHC19Q)'\n);\n```\n\nTherefore you will have best luck getting an `ANDROID_ID` from a Nexus 5X or\noverride the value via the options object for your particular device.\n\n## ID and User-Agent\n\nNote that you'll need to grab the device-id (`ANDROID_ID`) and associated\nuser-agents for best performance of the library.\n\n- `ANDROID_ID` - the ID for the device for Google. This is the GSF ID *not* the\n  id from dialing `*#*#8255#*#*`. You can get the gsf id e.g., using this following app: \n  [device id\n  app](https://play.google.com/store/apps/details?id=com.evozi.deviceid\u0026hl=en)\n  **WARNING**: This is not the androidId but the GSF Id that is needed by the library\n\n- Another way is to setup an HTTP proxy and install a CA to the device to see\n  the network traffic. Here is an example from a\n  [mitmproxy](https://github.com/mitmproxy/mitmproxy) session:\n\n![Device ID and API User-Agent](./docs/devid-ua-1.png?raw=true \"Device ID and API UA\")\n\n![Download User-Agent](./docs/download-ua.png?raw=true \"Download User Agent\")\n\nThese values can then be passed to the API so that apps can be downloaded with\nthe restrictions of the particular device.\n\n## requests defaults\nNote that this library uses the [`requests` module](https://github.com/request/request), therefore you can [control proxy behavior](https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables) or override defaults via the `requestDefaultsParams` option.\n\n## Debugging\n\nUse env variable `DEBUG` i.e., `DEBUG=gp:api` to enable debug output. This is done via [request-debug](https://github.com/request/request-debug).\n\nYou can provide the debug option too.\n```js\n{\n  username: username,\n  password: password,\n  androidId: androidId,\n  debug: false\n}\n```\n\n# EXAMPLES\n\n**Assumes you have set the following environment variables: `GOOGLE_LOGIN`, `GOOGLE_PASSWORD`, `ANDROID_ID`**\n\n## App details\n\n```javascript\n± % node examples/details.js | jq '.'\n{\n  \"docid\": \"com.viber.voip\",\n  \"backendDocid\": \"com.viber.voip\",\n  \"docType\": 1,\n  \"backendId\": 3,\n  \"title\": \"Viber\",\n  \"creator\": \"Viber Media S.à r.l.\",\n  \"descriptionHtml\": \"With Viber, everyone in the world can connect. Freely. More than 400 million Viber users text, call, and send photo and video messages worldwide over Wifi or 3G - for free. Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms.   \u003cp\u003eViber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.\u003cbr\u003eOn Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. \u003cp\u003e•\\tText with your friends\u003cbr\u003e•\\tMake free calls with HD sound quality\u003cbr\u003e•\\tPhoto sharing, video messages, voice messages, locations, stickers and emoticons\u003cbr\u003e•\\tGroups with up to 100 participants\u003cbr\u003e•\\tDownload stickers from the Sticker Market, making messaging fun! \u003cbr\u003e•\\tAbility to sort and reorder stickers\u003cbr\u003e•\\tPush notifications guarantee that you never miss a message or call, even when Viber is off\u003cbr\u003e•\\tIntegration with native contact list for calls and messages\u003cbr\u003e•\\tSupport for the Viber Desktop application on Windows and Mac \u003cbr\u003eLocalized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese\u003cbr\u003eViber is completely free with no advertising. \u003cbr\u003eWe value your privacy. \u003cp\u003eFollow us for updates and news:\u003cbr\u003eFacebook - \u003ca href=\\\"https://www.google.com/url?q=http://facebook.com/viber\u0026amp;sa=D\u0026amp;usg=AFQjCNGlVhJn65339uldBAp6MeFXZIV3mA\\\" target=\\\"_blank\\\"\u003ehttp://facebook.com/viber\u003c/a\u003e\u003cbr\u003eTwitter - \u003ca href=\\\"https://www.google.com/url?q=http://twitter.com/viber\u0026amp;sa=D\u0026amp;usg=AFQjCNG60qtBs85Z7vg5eeagjANxTrdSjQ\\\" target=\\\"_blank\\\"\u003ehttp://twitter.com/viber\u003c/a\u003e\u003cp\u003e(*) Network data charges may apply\",\n  \"offer\": [\n    {\n      \"micros\": \"0\",\n      \"currencyCode\": \"USD\",\n      \"formattedAmount\": \"Free\",\n      \"checkoutFlowRequired\": false,\n      \"offerType\": 1\n    }\n  ],\n ...\n```\n\n## Related apps\n\n```javascript\n± % node examples/related.js | jq '.'\n[\n  {\n    \"backendId\": 3,\n    \"title\": \"Similar apps\",\n    \"child\": [\n      {\n        \"docid\": \"com.skype.raider\",\n        \"backendDocid\": \"com.skype.raider\",\n        \"docType\": 1,\n        \"backendId\": 3,\n        \"title\": \"Skype - free IM \u0026 video calls\",\n        \"creator\": \"Skype\",\n        \"offer\": [\n          {\n            \"micros\": 0,\n            \"currencyCode\": \"USD\",\n            \"formattedAmount\": \"Free\",\n            \"checkoutFlowRequired\": false,\n            \"offerType\": 1\n          }\n        ],\n        \"availability\": {\n          \"restriction\": 1,\n          \"perdeviceavailabilityrestriction\": [\n            {\n              \"androidId\": xxxxxxxxxxxxxxx9983,\n              \"deviceRestriction\": 1,\n              \"channelId\": 83938807\n            }\n          ],\n          \"availableIfOwned\": true\n        },\n        ...\n      }\n  }\n]\n```\n\n## Download info\n\n```javascript\n± % node examples/downloadInfo.js | jq '.'\n{\n  \"url\": \"https://android.clients.google.com/market/download/Download?packageName=air.WatchESPN\u0026versionCode=2100039\u0026token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw\u0026downloadId=yyyyyyyyyyyyyyyyyyyy\",\n  \"cookies\": [\n    {\n      \"name\": \"MarketDA\",\n      \"value\": \"zzzzzzzzzzzzzzzzzzzz\"\n    }\n  ]\n}\n```\n\n## Complete Download info - complete object to be passed seamlessly to request.js\n\n```javascript\n± % node examples/completeDownloadInfo.js | jq '.'\n{ url: 'https://android.clients.google.com/market/download/Download?packageName=com.viber.voip\u0026versionCode=37\u0026ssl=1\u0026token=xxxxxxxxx\u0026downloadId=-xxxxxxxxxxx',\n  jar:\n   RequestJar {\n     _jar:\n      CookieJar {\n        enableLooseMode: true,\n        store: { idx: { 'android.clients.google.com': { '/market/download': { MarketDA: Cookie=\"MarketDA=xxxxxxxx; Path=/market/download; hostOnly=true; aAge=29ms; cAge=29ms\" } } } } } },\n  headers: \n   { 'User-Agent': 'AndroidDownloadManager/4.2.2 (Linux; U; Android 4.2.2; Galaxy Nexus Build/JDQ39)',\n     'Accept-Encoding': '' } }\n```\n\n# NOTES\n\n","funding_links":[],"categories":["Android Security","JavaScript","Tools"],"sub_categories":["Market Crawlers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweinstein%2Fnode-google-play","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdweinstein%2Fnode-google-play","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweinstein%2Fnode-google-play/lists"}