Skip to content

An API for interacting with the APK Pure website, allowing you to search for apps, retrieve app information, and download apps programmatically.

Notifications You must be signed in to change notification settings

thawancomt/apkpure-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apk Pure Api

An API for interacting with the APK Pure website, allowing you to search for apps, retrieve app information, and download apps programmatically.

Features

  • Search for Apps: Find apps on APK Pure by querying their name or keywords.
  • Get App Info: Retrieve detailed information about a specific app, including version, developer, ratings, and more.
  • Download App: Programmatically download the APK files of the apps.

Getting Started

Prerequisites

  • Python 3.7+
  • requests library
  • beautifulsoup4 library
  • tqdm library
  • cloudscraper library

Installation

  1. Clone the repository:
git clone https://github.com/thawancomt/apkpureAPI.git
cd apkpure
  1. Create a virtual environment:

    python -m venv venv
  2. Activate the virtual environment:

    • On Windows:

      .\venv\Scripts\activate
    • On macOS and Linux:

      source venv/bin/activate
  3. Install the required libraries:

    pip install -r requirements.txt

Usage

Here's a quick example of how to use the ApkPure class:

from apkpure.apkpure import ApkPure

# Import the API
from apkpure.apkpure import ApkPure

API = ApkPure()

# Get the first result from app
top_result = API.get_first_app_result(name='App Name')

# Get all apps from result
all_results = API.get_all_apps_results(name='App Name')

# Get info from an app
app_info = API.get_info(name='App Name')

# Get the versions of an app
versions = API.get_versions(name='App Name')

# Downlaod an app, you can pass a version and also the type of file between apk and xapk
# version and xapk are optional parameters
API.download(name='App Name', version='1.1.1', xapk=True)

Class: ApkPure

A class to interact with ApkPure for searching apps, retrieving app information, and downloading APK files.

__init__(verbose : bool = True) -> None

Initialize the ApkPure

search_top(name: str) -> str

Search for the top result of an app on APK Pure.

  • Parameters:
    • name (str): The name of the app to search for.
  • Returns:
    • str: A JSON string containing details of the top search result.
search_all(name: str) -> str

Search for all results of an app on APK Pure.

  • Parameters:
    • name (str): The name of the app to search for.
  • Returns:
    • str: A JSON string containing details of all search results.
get_versions(name: str) -> str

Retrieve all available versions of the specified app.

  • Parameters:
    • name (str): The name of the app.
  • Returns:
    • str: A JSON string containing the details of all available versions.
get_info(name: str) -> str

Retrieve detailed information about the specified app.

  • Parameters:
    • name (str): The name of the app.
  • Returns:
    • str: A JSON string containing detailed information about the app.
download(name: str, version: str = "") -> str | None

Download the specified version of the app. If no version is specified, download the latest version.

  • Parameters:
    • name (str): The name of the app.
    • version (str, optional): The version of the app to download. Defaults to the latest version.
  • Returns:
    • str | None: The real path to the downloaded APK file, or None if the version is invalid.

Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

Please make sure to update tests as appropriate.

Contact

If you have any questions, suggestions, or feedback, feel free to contact me:

License

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

About

An API for interacting with the APK Pure website, allowing you to search for apps, retrieve app information, and download apps programmatically.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%