{"swagger":"2.0","info":{"description":"API to interact with AppBrain.","version":"2.0","title":"AppBrain API","contact":{"name":"AppBrain Support","email":"contact@appbrain.com"}},"host":"api.appbrain.com","basePath":"/v2","tags":[{"name":"Reporting"},{"name":"Information"},{"name":"Devices"},{"name":"Promotion Campaigns"}],"schemes":["https"],"paths":{"/reports":{"get":{"tags":["Reporting"],"summary":"Export a report as CSV","description":"Exports your AppBrain data as CSV (the first line is the header). Dates with a time are UTC. Reports cover the last 30 days unless `startdate` / `enddate` say otherwise.\n\nReport types (`type`):\n* `promotion` — app promotion stats: date, impressions, clicks, installs, cost\n* `publisher` — AppBrain SDK revenue: date, impressions, clicks, installs, earning. Use `package=all` for all your apps\n* `billing` — promotion charges and added funds: date(utc), amount, balance, text\n* `earning` — SDK earnings and payouts: date(utc), amount, balance, text\n* `sdk` — installs and daily active users: date(utc), installs, daily_active\n* `ranking` — Google Play rankings: country, category and a series of dates","operationId":"getReport","produces":["text/csv","text/plain"],"parameters":[{"name":"type","in":"query","description":"The report to export","required":true,"type":"string","enum":["promotion","publisher","billing","earning","sdk","ranking"]},{"name":"package","in":"query","description":"The package name of the app, where the report needs one. `all` gives a publisher report over all your apps.","required":false,"type":"string"},{"name":"campaignid","in":"query","description":"The promotion campaign, when an app has more than one. Numbered from 0.","required":false,"type":"string"},{"name":"ad","in":"query","description":"Restrict a publisher report to one ad type (`banner`, `interstitial`, `total`) or ad ID (`ban-home_screen`, `int-123abc`).","required":false,"type":"string"},{"name":"startdate","in":"query","description":"Start of the reported range, MM/dd/yyyy.","required":false,"type":"string"},{"name":"enddate","in":"query","description":"End of the reported range, MM/dd/yyyy.","required":false,"type":"string"},{"name":"plain","in":"query","description":"Return `text/plain` instead of a CSV file download.","required":false,"type":"string"}],"security":[{"apikey":[]}],"responses":{"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/info/getcountries":{"get":{"tags":["Information"],"summary":"Countries information","description":"Returns a list of countries.","operationId":"getCountries","produces":["application/json","application/xml"],"parameters":[],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/CountryList"}}}}},"/device_stats/top_by_country":{"get":{"tags":["Devices"],"summary":"Top devices by country","description":"Returns the most used devices in a country. The API credential needs to be from an account that has a valid intelligence subscription.","operationId":"getTopDevicesByCountry","produces":["application/json","application/xml"],"parameters":[{"name":"country","in":"query","description":"2-letter country code","required":true,"type":"string"}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/DeviceList"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/info/getlibraries":{"get":{"tags":["Information"],"summary":"Libraries information","description":"Returns a list of known libraries used in apps.","operationId":"getLibraries","produces":["application/json","application/xml"],"parameters":[],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/LibraryList"}}}}},"/info/getapp":{"get":{"tags":["Information"],"summary":"App information","description":"Returns all information about an app. More information about usage and charges is available at <a href='https://www.appbrain.com/docs/api/pricing'>AppBrain API pricing</a>.","operationId":"getApp","produces":["application/json","application/xml"],"parameters":[{"name":"package","in":"query","description":"package","required":true,"type":"string"}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/AppInfo"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/campaigns/get":{"get":{"tags":["Promotion Campaigns"],"summary":"Retrieves a promotion campaign","description":"Retrieves the details of a promotion campaign.","operationId":"get","produces":["application/json","application/xml"],"parameters":[{"name":"campaign","in":"query","description":"campaign","required":true,"type":"string"}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/PromotionCampaign"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/campaigns/update":{"post":{"tags":["Promotion Campaigns"],"summary":"Creates or updates a promotion campaign","description":"Creates a new promotion campaign or updates an existing one.","operationId":"update","consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"the properties of the campaign that must be updated","required":true,"schema":{"$ref":"#/definitions/PromotionCampaignUpdates"}},{"name":"lowbidaction","in":"query","description":"what to do if a country bid is lower than the minimum allowed bid (ERROR: throw an error, RAISE: raise the country bid, STOP: stop campaign in the country)","required":false,"type":"string","enum":["ERROR","RAISE","STOP"]}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/campaigns/list":{"get":{"tags":["Promotion Campaigns"],"summary":"Lists all promotion campaigns","description":"Returns a list of identifiers of all promotion campaigns.","operationId":"list","produces":["application/json","application/xml"],"parameters":[{"name":"includeArchived","in":"query","description":"include archived campaigns","required":false,"type":"boolean","default":true}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/PromotionCampaignList"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/info/browse":{"get":{"tags":["Information"],"summary":"Apps information","description":"Returns a list of apps and everything about those apps. More information about usage and charges is available at <a href='https://www.appbrain.com/docs/api/pricing'>AppBrain API pricing</a>.","operationId":"browseApps","produces":["application/json","application/xml"],"parameters":[{"name":"sort","in":"query","description":"sort order of the results (default: POPULAR)","required":false,"type":"string","enum":["ALLTIME_DOWNLOADS","HOT-DAY","POPULAR_AUSTRALIA","POPULAR_BRAZIL","POPULAR_CANADA","POPULAR_DENMARK","POPULAR_FINLAND","POPULAR_FRANCE","POPULAR_GERMANY","POPULAR_HONGKONG","POPULAR_HUNGARY","POPULAR_INDIA","POPULAR_ITALY","POPULAR_JAPAN","POPULAR_KOREA","POPULAR_NETHERLANDS","POPULAR_NORWAY","POPULAR_POLAND","POPULAR_PORTUGAL","POPULAR_RUSSIA","POPULAR_SPAIN","POPULAR_SWEDEN","POPULAR_THAILAND","POPULAR_UK","POPULAR_USA","RATING","RECENT_DOWNLOADS","TIME"]},{"name":"filter","in":"query","description":"optional filter of the results","required":false,"type":"string","enum":["FREE","NEW","PAID","PRICE_REDUCED","UPDATED"]},{"name":"category","in":"query","description":"optional filter for the Google Play category","required":false,"type":"string","enum":["APPLICATION","GAME","ACTION","ADVENTURE","ARCADE","ART_DESIGN","AUTO","BEAUTY","BOARD","BOOKS_REFERENCE","BUSINESS","CARD","CASINO","CASUAL","COMICS","COMMUNICATION","DATING","EDUCATION","EDUCATIONAL","ENTERTAINMENT","EVENTS","FINANCE","FOOD_DRINK","HEALTH_FITNESS","HOUSE_HOME","LIBRARIES_DEMO","LIFESTYLE","MEDIA_VIDEO","MEDICAL","MUSIC","MUSIC_AUDIO","NEWS_MAGAZINES","PARENTING","PERSONALIZATION","PHOTOGRAPHY","PRODUCTIVITY","PUZZLE","RACING","ROLE_PLAYING","SHOPPING","SIMULATION","SOCIAL","SPORTS","SPORTS_GAMES","STRATEGY","TOOLS","TRANSPORTATION","TRAVEL_LOCAL","TRIVIA","WEATHER","WORD"]},{"name":"offset","in":"query","description":"offset of the browse results (default 0; max 500)","required":false,"type":"integer","format":"int32"},{"name":"limit","in":"query","description":"number of the browse results (default 10; max 50)","required":false,"type":"integer","format":"int32"}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/AppInfoList"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}},"/info/search":{"get":{"tags":["Information"],"summary":"Apps information","description":"Returns a list of apps and everything about those apps. More information about usage and charges is available at <a href='https://www.appbrain.com/docs/api/pricing'>AppBrain API pricing</a>.","operationId":"searchApps","produces":["application/json","application/xml"],"parameters":[{"name":"query","in":"query","description":"search query","required":false,"type":"string"},{"name":"sort","in":"query","description":"sort order of the results (default: RELEVANCY)","required":false,"type":"string","enum":["ALLTIME_DOWNLOADS","HOT-DAY","POPULAR_AUSTRALIA","POPULAR_BRAZIL","POPULAR_CANADA","POPULAR_DENMARK","POPULAR_FINLAND","POPULAR_FRANCE","POPULAR_GERMANY","POPULAR_HONGKONG","POPULAR_HUNGARY","POPULAR_INDIA","POPULAR_ITALY","POPULAR_JAPAN","POPULAR_KOREA","POPULAR_NETHERLANDS","POPULAR_NORWAY","POPULAR_POLAND","POPULAR_PORTUGAL","POPULAR_RUSSIA","POPULAR_SPAIN","POPULAR_SWEDEN","POPULAR_THAILAND","POPULAR_UK","POPULAR_USA","RATING","RECENT_DOWNLOADS","RELEVANCY","TIME"]},{"name":"filter","in":"query","description":"optional filter of the results","required":false,"type":"string","enum":["FREE","NEW","PAID","PRICE_REDUCED","UPDATED"]},{"name":"category","in":"query","description":"optional filter for the Google Play category","required":false,"type":"string","enum":["APPLICATION","GAME","ACTION","ADVENTURE","ARCADE","ART_DESIGN","AUTO","BEAUTY","BOARD","BOOKS_REFERENCE","BUSINESS","CARD","CASINO","CASUAL","COMICS","COMMUNICATION","DATING","EDUCATION","EDUCATIONAL","ENTERTAINMENT","EVENTS","FINANCE","FOOD_DRINK","HEALTH_FITNESS","HOUSE_HOME","LIBRARIES_DEMO","LIFESTYLE","MEDIA_VIDEO","MEDICAL","MUSIC","MUSIC_AUDIO","NEWS_MAGAZINES","PARENTING","PERSONALIZATION","PHOTOGRAPHY","PRODUCTIVITY","PUZZLE","RACING","ROLE_PLAYING","SHOPPING","SIMULATION","SOCIAL","SPORTS","SPORTS_GAMES","STRATEGY","TOOLS","TRANSPORTATION","TRAVEL_LOCAL","TRIVIA","WEATHER","WORD"]},{"name":"offset","in":"query","description":"offset of the browse results (default 0; max 500)","required":false,"type":"integer","format":"int32"},{"name":"limit","in":"query","description":"number of the browse results (default 10; max 50)","required":false,"type":"integer","format":"int32"}],"security":[{"apikey":[]}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/AppInfoList"}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized request"},"429":{"description":"Too many requests"}}}}},"securityDefinitions":{"apikey":{"description":"The API key for AppBrain API","type":"apiKey","name":"apikey","in":"query"}},"definitions":{"CountryInfo":{"type":"object","properties":{"code":{"type":"string","description":"country code"},"name":{"type":"string","description":"name of the country"},"minCpiBid":{"type":"number","format":"double","description":"minimum cost-per-install bid for app promotions in this country"}},"description":"Information about a country"},"CountryList":{"type":"object","properties":{"countries":{"type":"array","xml":{"wrapped":true},"description":"country information","items":{"xml":{"name":"country"},"$ref":"#/definitions/CountryInfo"}}},"description":"List of countries"},"DeviceInfo":{"type":"object","properties":{"rank":{"type":"integer","format":"int32","description":"rank"},"name":{"type":"string","description":"name of the device"},"modelName":{"type":"string","description":"model name"},"deviceName":{"type":"string","description":"device name"},"manufacturerName":{"type":"string","description":"manufacturer"},"absolutePopularity":{"type":"number","format":"double","description":"absolute popularity (market share in country)"},"relativePopularity":{"type":"number","format":"double","description":"relative popularity (the share of the global market of a phone or tablet for this country)"}},"description":"Information about a device"},"DeviceList":{"type":"object","properties":{"devices":{"type":"array","xml":{"wrapped":true},"description":"Device information","items":{"xml":{"name":"device"},"$ref":"#/definitions/DeviceInfo"}}},"description":"List of devices"},"Library":{"type":"object","properties":{"id":{"type":"string","description":"identifier for the library"},"name":{"type":"string","description":"name of the library"},"description":{"type":"string","description":"description of the library"},"types":{"type":"array","description":"types of the library","items":{"type":"string"}},"tags":{"type":"array","description":"tags associated with the library","items":{"type":"string"}},"officialUrl":{"type":"string","description":"official URL of the library"},"appBrainUrl":{"type":"string","description":"AppBrain URL of the library"}},"description":"Information about a library"},"LibraryList":{"type":"object","properties":{"libraries":{"type":"array","xml":{"wrapped":true},"description":"library information","items":{"xml":{"name":"library"},"$ref":"#/definitions/Library"}}},"description":"List of known libraries"},"AppInfo":{"type":"object","properties":{"package":{"type":"string","description":"package"},"versionString":{"type":"string","description":"most recent version"},"versionCode":{"type":"integer","format":"int32","description":"most recent version code"},"name":{"type":"string","description":"name of the app"},"shortDescription":{"type":"string","description":"short one-line description of the app"},"description":{"type":"string","description":"description of the app"},"marketCategory":{"type":"string","description":"market category of the app"},"price":{"type":"string","description":"price of the app"},"apkSize":{"type":"integer","format":"int64","description":"size of the APK"},"maturityLevel":{"type":"string","description":"maturity level of the app","enum":["EVERYONE","LOW","MEDIUM","HIGH"]},"minSdkVersion":{"type":"integer","format":"int32","description":"minimum supported SDK version"},"maxSdkVersion":{"type":"integer","format":"int32","description":"maximum supported SDK version"},"supportsApp2SD":{"type":"string","description":"whether the app can be installed on external storage","enum":["TRUE","FALSE"]},"launchTime":{"type":"integer","format":"int32","description":"timestamp of the app's launch in seconds since epoch"},"lastAppUpdateTime":{"type":"integer","format":"int32","description":"timestamp of the app's latest update in seconds since epoch"},"infoRefreshTime":{"type":"integer","format":"int32","description":"timestamp of the last refresh of the app information in seconds since epoch"},"downloadsCategory":{"type":"string","description":"Google play category of the number of downloads"},"estimatedDownloads":{"type":"integer","format":"int64","description":"estimated number of downloads"},"estimatedRecentDownloads":{"type":"integer","format":"int64","description":"estimated number of downloads in the last 30 days"},"rating":{"type":"number","format":"double","description":"average rating"},"recentRating":{"type":"number","format":"double","description":"average rating (deprecated, present for historic reasons)"},"ratingCount":{"type":"integer","format":"int32","description":"number of ratings"},"rating1StarCount":{"type":"integer","format":"int32","description":"number of 1-star ratings"},"rating2StarCount":{"type":"integer","format":"int32","description":"number of 2-star ratings"},"rating3StarCount":{"type":"integer","format":"int32","description":"number of 3-star ratings"},"rating4StarCount":{"type":"integer","format":"int32","description":"number of 4-star ratings"},"rating5StarCount":{"type":"integer","format":"int32","description":"number of 5-star ratings"},"plusOneCount":{"type":"integer","format":"int32","description":"number of +1s"},"commentCount":{"type":"integer","format":"int32","description":"number of comments"},"iconUrl":{"type":"string","description":"URL of the app's icon"},"featureGraphicUrl":{"type":"string","description":"URL of the app's feature graphic"},"youtubeUrl":{"type":"string","description":"YouTube URL of the app's promo video"},"developerName":{"type":"string","description":"name of the developer of the app"},"developerEmail":{"type":"string","description":"email address of the developer"},"developerAddress":{"type":"string","description":"address of the developer"},"website":{"type":"string","description":"official website of the app"},"screenshotUrls":{"type":"array","xml":{"wrapped":true},"description":"URLs of the app's screenshots","items":{"type":"string","xml":{"name":"screenshotUrl"}}},"permissions":{"type":"array","xml":{"wrapped":true},"description":"requested permissions","items":{"type":"string","xml":{"name":"permission"}}},"libraries":{"type":"array","xml":{"wrapped":true},"description":"libraries used in the app","items":{"type":"string","xml":{"name":"library"}}}},"description":"Everything about an app"},"Country":{"type":"object","properties":{"code":{"type":"string","description":"the two-letter ISO country code"},"cpi":{"type":"number","format":"double","description":"the maximum cost-per-install for a country in dollars"}},"description":"Settings for a country in the promotion campaign"},"PromotionCampaign":{"type":"object","properties":{"campaign":{"type":"string","description":"identifier of the promotion campaign"},"state":{"type":"string","description":"state of the promotion campaign"},"name":{"type":"string","description":"name/description of the promotion campaign"},"title":{"type":"string","description":"promotion title of the promotion campaign"},"subtitle":{"type":"string","description":"promotion subtitle of the promotion campaign"},"dailyBudget":{"type":"number","format":"double","description":"daily budget of the promotion campaign in dollars"},"remainingBudget":{"type":"number","format":"double","description":"total remaining budget the promotion campaign in dollars"},"installTracking":{"type":"string","description":"attribution partner that is used for install tracking","enum":["APPBRAIN","ADJUST","APPSFLYER","SINGULAR","KOCHAVA","TUNE","BRANCH"]},"clickthroughUrl":{"type":"string","description":"clickthrough URL of the promotion campaign"},"countries":{"type":"array","xml":{"wrapped":true},"description":"list of settings for each country where the campaign is running","items":{"xml":{"name":"country"},"$ref":"#/definitions/Country"}},"allowedSubIds":{"type":"array","xml":{"wrapped":true},"description":"list of publisher subIDs to allow for this campaign","items":{"type":"string","xml":{"name":"allowedSubId"}}},"blockedSubIds":{"type":"array","xml":{"wrapped":true},"description":"list of publisher subIDs to block for this campaign","items":{"type":"string","xml":{"name":"blockedSubId"}}}},"description":"All details of a promotion campaign"},"PromotionCampaignUpdates":{"type":"object","required":["campaign"],"properties":{"campaign":{"type":"string","description":"identifier of the promotion campaign (i.e. the package of the promoted app, eventually followed by a dash and an index for multiple campaigns per app.)"},"state":{"type":"string","description":"state of the promotion campaign","enum":["RUNNING","STOPPED"]},"name":{"type":"string","description":"name/description of the promotion campaign"},"title":{"type":"string","description":"promotion title of the promotion campaign"},"subtitle":{"type":"string","description":"promotion subtitle of the promotion campaign"},"dailyBudget":{"type":"number","format":"double","description":"daily budget of the promotion campaign in dollars (a negative value indicates no budget limit)"},"remainingBudget":{"type":"number","format":"double","description":"total remaining budget the promotion campaign in dollars (a negative value indicates no budget limit)"},"installTracking":{"type":"string","description":"attribution partner that is used for install tracking","enum":["APPBRAIN","ADJUST","APPSFLYER","SINGULAR","KOCHAVA","TUNE","BRANCH"]},"clickthroughUrl":{"type":"string","description":"clickthrough URL of the promotion campaign"},"countries":{"type":"array","xml":{"wrapped":true},"description":"list of settings for each country where the campaign is running; setting this list overwrites all country settings for the promotion campaign (can't be used simultaneously with updateCountries or removeCountries)","items":{"xml":{"name":"country"},"$ref":"#/definitions/Country"}},"updateCountries":{"type":"array","xml":{"wrapped":true},"description":"updates the provided settings for the countries (can't be used simultaneously with countries)","items":{"xml":{"name":"updateCountry"},"$ref":"#/definitions/Country"}},"removeCountries":{"type":"array","xml":{"wrapped":true},"description":"removes the provided countries from the promotion campaign (can't be used simultaneously with countries)","items":{"type":"string","xml":{"name":"removeCountry"}}},"allowedSubIds":{"type":"array","xml":{"wrapped":true},"description":"list of publisher subIDs to allow for this campaign; setting this list overwrites all existing allowed subIDs (can't be used simultaneously with addAllowedSubIds)","items":{"type":"string","xml":{"name":"allowedSubId"}}},"addAllowedSubIds":{"type":"array","xml":{"wrapped":true},"description":"adds publisher subIDs to the list of allowed subIDs (can't be used simultaneously with allowedSubIds)","items":{"type":"string","xml":{"name":"addAllowedSubId"}}},"blockedSubIds":{"type":"array","xml":{"wrapped":true},"description":"list of publisher subIDs to block for this campaign; setting this list overwrites all existing blocked subIDs (can't be used simultaneously with addBlockedSubIds)","items":{"type":"string","xml":{"name":"blockedSubId"}}},"addBlockedSubIds":{"type":"array","xml":{"wrapped":true},"description":"adds publisher subIDs to the list of blocked subIDs (can't be used simultaneously with blockedSubIds)","items":{"type":"string","xml":{"name":"addBlockedSubId"}}}},"description":"Updates for a promotion campaign"},"PromotionCampaignList":{"type":"object","properties":{"campaigns":{"type":"array","xml":{"wrapped":true},"description":"identifiers of existing promotion campaigns","items":{"type":"string","xml":{"name":"campaign"}}}},"description":"List of promotion campaigns"},"AppInfoList":{"type":"object","properties":{"apps":{"type":"array","xml":{"wrapped":true},"description":"List of apps","items":{"xml":{"name":"app"},"$ref":"#/definitions/AppInfo"}}},"description":"List of apps"}},"externalDocs":{"description":"AppBrain API Documentation","url":"https://www.appbrain.com/docs/api/specification"}}