Skip to main content

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

Project description

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

Installation

First Method:

pip install apkpure
Second Method: 1. Clone the repository:
git clone https://github.com/anishomsy/apkpure.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 requests beautifulsoup4 tqdm
    

    or

    pip install -r requirements.txt
    

Usage

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

from apkpure.apkpure import ApkPure

# Initialize the API
api = ApkPure()

# Search for an app and get top result
top_result = api.search_top("WhatsApp")
print(top_result)

# Search for all results
all_results = api.search_all("WhatsApp")
print(all_results)

# Get app versions
versions = api.get_versions("WhatsApp")
print(versions)

# Get app info
app_info = api.get_info("WhatsApp")
print(app_info)

# Download the latest version of an app
download_path = api.download("whatsapp")
print(download_path)

# Download a specific version of an app
api.download("WhatsApp", version="2.21.1.15")

Class: ApkPure

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

__init__(headers: dict | None = None) -> None

Initialize the ApkPure instance with optional headers.

  • Parameters:
    • headers (dict | None): Optional headers for HTTP requests.
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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apkpure-0.3.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

apkpure-0.3.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file apkpure-0.3.0.tar.gz.

File metadata

  • Download URL: apkpure-0.3.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.5-zen1-1-zen

File hashes

Hashes for apkpure-0.3.0.tar.gz
Algorithm Hash digest
SHA256 afc369d1ec6b672730b1f374ee964035818cd526f0fb00e152ae53992e994e3c
MD5 949091d4bedd1a2571d62db089610b38
BLAKE2b-256 8607ee2a50fec1f55a6b055aa7d627325e17a8f2c7802f52e4af0200722a2a7d

See more details on using hashes here.

File details

Details for the file apkpure-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: apkpure-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.5-zen1-1-zen

File hashes

Hashes for apkpure-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6430bd40cdf4dbe03270fa1ccddf051b6b295bd91f0e597b8e9b515bb9e076b
MD5 d5b11ee2d5a7e3f71694e6cd9befed27
BLAKE2b-256 bad730663a8d87f5f0cb39bc16115302fb35dcd8e2c89defb690c0f37111243d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page