Android Play 스토어에서 데이터 가져 오기
Android Play 스토어의 데이터를 사용하는 일부 앱과 웹 사이트를 보았습니다. 예 : 앱 순위가 가장 높은 앱 또는 사이트 등.하지만 데이터를 어떻게 얻을 수 있습니까? 어디서 파싱 할 수 있습니까?
필요한 정보를 얻기 위해 사용할 수 있는 Android 마켓 용 비공식 오픈 소스 API 가 있습니다. 도움이 되었기를 바랍니다.
Google Play에서 앱을 스크랩하고 데이터를 나열하기 위해 작은 Node.js 모듈을 코딩했습니다. google-play-scraper
var gplay = require('google-play-scrapper');
gplay.List({
category: gplay.category.GAME_ACTION,
collection: gplay.collection.TOP_FREE,
num: 2
}).then(console.log);
결과 :
[ { url: 'https://play.google.com/store/apps/details?id=com.playappking.busrush',
appId: 'com.playappking.busrush',
title: 'Bus Rush',
developer: 'Play App King',
icon: 'https://lh3.googleusercontent.com/R6hmyJ6ls6wskk5hHFoW02yEyJpSG36il4JBkVf-Aojb1q4ZJ9nrGsx6lwsRtnTqfA=w340',
score: 3.9,
price: '0',
free: false },
{ url: 'https://play.google.com/store/apps/details?id=com.yodo1.crossyroad',
appId: 'com.yodo1.crossyroad',
title: 'Crossy Road',
developer: 'Yodo1 Games',
icon: 'https://lh3.googleusercontent.com/doHqbSPNekdR694M-4rAu9P2B3V6ivff76fqItheZGJiN4NBw6TrxhIxCEpqgO3jKVg=w340',
score: 4.5,
price: '0',
free: false } ]
면책 조항 : 나는 이미 https://42matters.com/api 에서이 데이터를 제공하는 42matters 출신입니다. 자유롭게 확인하거나 저희에게 연락주세요.
lenik이 언급했듯이 이미 GPlay에서 일부 데이터를 얻는 데 도움이되는 오픈 소스 라이브러리가 있습니다. 직접 빌드하려면 Google Play 앱 페이지를 구문 분석 할 수 있지만 다음 사항에주의해야합니다.
- 구문 분석하려는 URL이 robots.txt에서 차단되지 않았는지 확인하십시오 (예 : https://play.google.com/robots.txt).
- 너무 자주하지 않는지 확인하세요. 너무 많이하는 경우 Google에서 제한하고 잠재적으로 블랙리스트에 올립니다.
- 올바른 User-Agent 헤더를 보내 실제로 봇임을 보여줍니다.
- 앱 페이지가 큽니다. gzip을 수락하고 모바일 버전을 요청하세요.
- GPlay 웹 사이트는 API가 아니므로 구문 분석을해도 시간이 지나면 변경됩니다. 변경 사항을 처리해야합니다. 예를 들어 예상 한 내용을 얻었는지 테스트하여
따라서 하나의 페이지 메타 데이터를 얻는 것은 페이지 html을 가져와 제대로 파싱하는 문제입니다. JSoup 을 사용 하면 다음을 시도 할 수 있습니다.
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet request = new HttpGet(crawlUrl);
HttpResponse rsp = httpClient.execute(request);
int statusCode = rsp.getStatusLine().getStatusCode();
if (statusCode == 200) {
String content = EntityUtils.toString(rsp.getEntity());
Document doc = Jsoup.parse(content);
//parse content, whatever you need
Element price = doc.select("[itemprop=price]").first();
}
시작해야 할 매우 간단한 사용 사례입니다. 그러나 더 흥미로운 일을하고 싶은 순간 상황이 복잡해집니다.
- 로봇에서는 검색이 금지되어 있습니다.
- 앱 메타 데이터를 최신 상태로 유지하는 것은 어렵습니다. 220 만 개 이상의 앱이 있습니다. 매일 메타 데이터를 새로 고치려면 하루에 2.2 개의 요청이 있습니다. 1) 즉시 차단되고 2) 많은 비용이 듭니다. 하나의 앱이 10 만인 경우 하루에 220GB 데이터 전송이 비관적입니다.
- 새로운 앱을 어떻게 발견합니까
- 각 국가의 가격, 각 언어의 번역은 어떻게 받습니까?
The list goes on. If you don't want to do all this by yourself, you can consider 42matters API, which supports lookup and search, top google charts, advanced queries and filters. And this for 35 languages and more than 50 countries.
The Google Play Store doesn't provide this data, so the sites must just be scraping it.
Here's a google chrome extension that'll allow you to download your reviews: https://chrome.google.com/webstore/detail/my-play-store-reviews/ldggikfajgoedghjnflfafiiheagngoa?hl=en
참고URL : https://stackoverflow.com/questions/10272155/getting-data-from-android-play-store
'Program Club' 카테고리의 다른 글
| C 조건부 전 처리기 지시문에서 문자열을 비교하는 방법 (0) | 2020.10.12 |
|---|---|
| 원자 운영 비용 (0) | 2020.10.12 |
| CreateProcess 오류 = 206, main () 메서드를 실행할 때 파일 이름 또는 확장자가 너무 깁니다. (0) | 2020.10.12 |
| 비동기 PartialView로 인해 "HttpServerUtility.Execute 차단됨…"예외 발생 (0) | 2020.10.12 |
| FFT 출력 이해 (0) | 2020.10.12 |