Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 2.33 KB

File metadata and controls

80 lines (55 loc) · 2.33 KB

Maven Central GitHub release (latest by date)

AppBrain API Client library for Java / Kotlin

The AppBrain API allows you to programmatically access data about apps on Google Play. Queries for specific apps, search and browse are supported. AppBrain advertisers can manage their campaign.

Installation

Add this dependency to your project's POM:

<dependency>
  <groupId>com.appbrain</groupId>
  <artifactId>appbrain-api-client</artifactId>
  <version>1.2.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

implementation "com.appbrain:appbrain-api-client:1.2.0"

Getting Started

Please follow the installation instruction and execute the following Java code:

package com.appbrain.client.demo;

import com.appbrain.client.ApiClient;
import com.appbrain.client.ApiException;
import com.appbrain.client.Configuration;
import com.appbrain.client.api.InformationApi;
import com.appbrain.client.model.AppInfoList;

public class ApiClientDemo {

    public static void main(String[] args) {
        ApiClient apiClient = Configuration.getDefaultApiClient();

        // Get the API key from https://developers.appbrain.com/dev_dashboard#DevPagePlace:page=api
        // for more information see: https://www.appbrain.com/docs/api/appbrain-api
        apiClient.setApiKey("<APIKEY>");

        InformationApi api = new InformationApi(apiClient);
        String sort = null;
        String filter = null;
        String category = null;

        try {
            AppInfoList result = api.searchApps("youtube", sort, filter, category, 0, null);
            System.out.println(result.getApps().get(0));
        } catch (ApiException e) {
            System.err.println(" " + e);
            System.err.println(" " + e.getResponseBody());
        }
    }
}

Documentation for AppBrain API

Please see here: https://www.appbrain.com/docs/api/specification

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

AppBrain API Team - contact@appbrain.com