How to Crawl Android APK from apkpure

adewaleng

adewaleng

Posted on November 11, 2022

How to Crawl Android APK from apkpure

The article will guide you to quickly crawl and download Android applications from the apkpure.

The factors important for that are

  1. Browser (such as Chrome)
  2. NodeJS (install)

Analysis web page

Select an application from the home page to enter the download page. For example, I select this page and use F12 shortcut to open the console. Select the download button to see the download link of the application.
download url

Access this link to download the latest version of the application.

If you want to download other packages, you only need to download and modify the package name in the link:
https://d.apkpure.com/b/APK/{PACKAGE_NAME}?version=latest
If you want to download other versions of packages, you can specify the version code:
https://d.apkpure.com/b/APK/{PACKAGE_NAME}?versionCode={VERSION_CODE}

Other information about the package can be obtained through another page, such as version number, developer, release date, etc.
apk info

We can also get all the historical versions of the application through the historical version page. It should be noted here that the file types are divided into XAPK and APK. XAPK requires a special installer to install on the device, so we only need APK files.
other versions

Scraping APK through crawlers

1. Downloading APK

We already know the assembly rules of the download link. We only need to download it through the package name. Enter the assembled download link (e. g. https://d.apkpure.com/b/APK/com.ea.gp.fifamobile?version=latest) into the browser to download it directly.

However, if you want to download it outside the browser, you will be blocked by the Cloudflare. In order to avoid being blocked, we can use the js package puppeteer to simulate the browser's access behavior and download.

2. Scraping APK Details

In order to prevent requests from being intercepted by Cloudflare, scraping APK details can also be implemented using puppeteer.

For example, after opening the apkpure application details page, you can obtain the application details through the following program.
code

Obtained through the js package provided by the author

If you think it is very troublesome to realize this ability, you can choose js package apkpure-crawler provided by the author. The usage is also very simple:

If you already have a NodeJS and npm, you can simply install the program to your computer through the following command

npm install -g apkpure-crawler
Enter fullscreen mode Exit fullscreen mode

This tool can provide the following abilities:

# get package download url with package name
apkcrawl get com.ea.gp.fifamobile

# download package with package name
apkcrawl down com.ea.gp.fifamobile

# crawler package info with package name
apkcrawl crawler com.ea.gp.fifamobile
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
adewaleng
adewaleng

Posted on November 11, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related