google-play-scraper-fetch 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +82 -0
- package/dist/index.cjs +529 -0
- package/dist/index.d.cts +158 -0
- package/dist/index.d.ts +158 -0
- package/dist/index.js +496 -0
- package/package.json +55 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
interface AppCategory {
|
|
2
|
+
name: string | undefined;
|
|
3
|
+
id: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
interface AppHistogram {
|
|
6
|
+
'1': number;
|
|
7
|
+
'2': number;
|
|
8
|
+
'3': number;
|
|
9
|
+
'4': number;
|
|
10
|
+
'5': number;
|
|
11
|
+
}
|
|
12
|
+
interface AppOptions {
|
|
13
|
+
appId: string;
|
|
14
|
+
lang?: string;
|
|
15
|
+
country?: string;
|
|
16
|
+
/** Custom fetch implementation. Defaults to the global fetch. */
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
}
|
|
19
|
+
interface AppDetails {
|
|
20
|
+
appId: string;
|
|
21
|
+
url: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
descriptionHTML: string;
|
|
25
|
+
summary: string | undefined;
|
|
26
|
+
installs: string | undefined;
|
|
27
|
+
minInstalls: number | undefined;
|
|
28
|
+
maxInstalls: number | undefined;
|
|
29
|
+
score: number | undefined;
|
|
30
|
+
scoreText: string | undefined;
|
|
31
|
+
ratings: number | undefined;
|
|
32
|
+
reviews: number | undefined;
|
|
33
|
+
histogram: AppHistogram;
|
|
34
|
+
price: number;
|
|
35
|
+
originalPrice: number | undefined;
|
|
36
|
+
discountEndDate: string | undefined;
|
|
37
|
+
free: boolean;
|
|
38
|
+
currency: string | undefined;
|
|
39
|
+
priceText: string;
|
|
40
|
+
available: boolean;
|
|
41
|
+
offersIAP: boolean;
|
|
42
|
+
IAPRange: string | undefined;
|
|
43
|
+
androidVersion: string;
|
|
44
|
+
androidVersionText: string;
|
|
45
|
+
androidMaxVersion: string;
|
|
46
|
+
developer: string | undefined;
|
|
47
|
+
developerId: string | undefined;
|
|
48
|
+
developerEmail: string | undefined;
|
|
49
|
+
developerWebsite: string | undefined;
|
|
50
|
+
developerAddress: string | undefined;
|
|
51
|
+
developerLegalName: string | undefined;
|
|
52
|
+
developerLegalEmail: string | undefined;
|
|
53
|
+
developerLegalAddress: string | undefined;
|
|
54
|
+
developerLegalPhoneNumber: string | undefined;
|
|
55
|
+
developerInternalID: string | undefined;
|
|
56
|
+
privacyPolicy: string | undefined;
|
|
57
|
+
genre: string | undefined;
|
|
58
|
+
genreId: string | undefined;
|
|
59
|
+
categories: AppCategory[];
|
|
60
|
+
icon: string | undefined;
|
|
61
|
+
headerImage: string | undefined;
|
|
62
|
+
screenshots: string[];
|
|
63
|
+
video: string | undefined;
|
|
64
|
+
videoImage: string | undefined;
|
|
65
|
+
previewVideo: string | undefined;
|
|
66
|
+
contentRating: string | undefined;
|
|
67
|
+
contentRatingDescription: string | undefined;
|
|
68
|
+
adSupported: boolean;
|
|
69
|
+
released: string | undefined;
|
|
70
|
+
updated: number | undefined;
|
|
71
|
+
version: string;
|
|
72
|
+
recentChanges: string | undefined;
|
|
73
|
+
comments: (string | undefined)[];
|
|
74
|
+
preregister: boolean;
|
|
75
|
+
earlyAccessEnabled: boolean;
|
|
76
|
+
isAvailableInPlayPass: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Fetch the Play Store details page for an app and extract its metadata.
|
|
80
|
+
* Field paths are ported from google-play-scraper's lib/app.js MAPPINGS.
|
|
81
|
+
*/
|
|
82
|
+
declare function app(options: AppOptions): Promise<AppDetails>;
|
|
83
|
+
|
|
84
|
+
declare const BASE_URL = "https://play.google.com";
|
|
85
|
+
/** Review sort orders, matching the original google-play-scraper values. */
|
|
86
|
+
declare const sort: {
|
|
87
|
+
readonly NEWEST: 2;
|
|
88
|
+
readonly RATING: 3;
|
|
89
|
+
readonly HELPFULNESS: 1;
|
|
90
|
+
};
|
|
91
|
+
type SortValue = (typeof sort)[keyof typeof sort];
|
|
92
|
+
|
|
93
|
+
/** Base class for all errors thrown by this package. */
|
|
94
|
+
declare class PlayScraperError extends Error {
|
|
95
|
+
constructor(message: string);
|
|
96
|
+
}
|
|
97
|
+
/** Thrown when the HTTP request to Google Play fails or returns a non-2xx status. */
|
|
98
|
+
declare class PlayScraperHttpError extends PlayScraperError {
|
|
99
|
+
readonly status: number;
|
|
100
|
+
readonly url: string;
|
|
101
|
+
constructor(message: string, status: number, url: string);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Thrown when the response from Google Play cannot be parsed into the expected
|
|
105
|
+
* shape. Google Play uses an internal, undocumented protocol; when it changes,
|
|
106
|
+
* this error is the signal. The `context` field describes which part of the
|
|
107
|
+
* parse failed and includes a snippet of the offending data.
|
|
108
|
+
*/
|
|
109
|
+
declare class PlayScraperParseError extends PlayScraperError {
|
|
110
|
+
readonly context: string;
|
|
111
|
+
constructor(message: string, context: string);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface ReviewCriteria {
|
|
115
|
+
criteria: string | undefined;
|
|
116
|
+
rating: number | null;
|
|
117
|
+
}
|
|
118
|
+
interface Review {
|
|
119
|
+
id: string;
|
|
120
|
+
userName: string | undefined;
|
|
121
|
+
userImage: string | undefined;
|
|
122
|
+
date: string | null;
|
|
123
|
+
score: number | undefined;
|
|
124
|
+
scoreText: string;
|
|
125
|
+
url: string;
|
|
126
|
+
title: null;
|
|
127
|
+
text: string | undefined;
|
|
128
|
+
replyDate: string | null;
|
|
129
|
+
replyText: string | null;
|
|
130
|
+
version: string | null;
|
|
131
|
+
thumbsUp: number | undefined;
|
|
132
|
+
criterias: ReviewCriteria[];
|
|
133
|
+
}
|
|
134
|
+
interface ReviewsOptions {
|
|
135
|
+
appId: string;
|
|
136
|
+
lang?: string;
|
|
137
|
+
country?: string;
|
|
138
|
+
sort?: SortValue;
|
|
139
|
+
num?: number;
|
|
140
|
+
/** When true, make a single request and return the pagination token. */
|
|
141
|
+
paginate?: boolean;
|
|
142
|
+
/** Token from a previous paginated call to fetch the next page. */
|
|
143
|
+
nextPaginationToken?: string | null;
|
|
144
|
+
/** Custom fetch implementation. Defaults to the global fetch. */
|
|
145
|
+
fetch?: typeof fetch;
|
|
146
|
+
}
|
|
147
|
+
interface ReviewsResult {
|
|
148
|
+
data: Review[];
|
|
149
|
+
nextPaginationToken: string | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Fetch reviews for an app from Play's internal batchexecute endpoint.
|
|
153
|
+
* Request shape and response mappings are ported from google-play-scraper's
|
|
154
|
+
* lib/reviews.js (rpcid UsvDTd).
|
|
155
|
+
*/
|
|
156
|
+
declare function reviews(options: ReviewsOptions): Promise<ReviewsResult>;
|
|
157
|
+
|
|
158
|
+
export { type AppCategory, type AppDetails, type AppHistogram, type AppOptions, BASE_URL, PlayScraperError, PlayScraperHttpError, PlayScraperParseError, type Review, type ReviewCriteria, type ReviewsOptions, type ReviewsResult, type SortValue, app, reviews, sort };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
interface AppCategory {
|
|
2
|
+
name: string | undefined;
|
|
3
|
+
id: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
interface AppHistogram {
|
|
6
|
+
'1': number;
|
|
7
|
+
'2': number;
|
|
8
|
+
'3': number;
|
|
9
|
+
'4': number;
|
|
10
|
+
'5': number;
|
|
11
|
+
}
|
|
12
|
+
interface AppOptions {
|
|
13
|
+
appId: string;
|
|
14
|
+
lang?: string;
|
|
15
|
+
country?: string;
|
|
16
|
+
/** Custom fetch implementation. Defaults to the global fetch. */
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
}
|
|
19
|
+
interface AppDetails {
|
|
20
|
+
appId: string;
|
|
21
|
+
url: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
descriptionHTML: string;
|
|
25
|
+
summary: string | undefined;
|
|
26
|
+
installs: string | undefined;
|
|
27
|
+
minInstalls: number | undefined;
|
|
28
|
+
maxInstalls: number | undefined;
|
|
29
|
+
score: number | undefined;
|
|
30
|
+
scoreText: string | undefined;
|
|
31
|
+
ratings: number | undefined;
|
|
32
|
+
reviews: number | undefined;
|
|
33
|
+
histogram: AppHistogram;
|
|
34
|
+
price: number;
|
|
35
|
+
originalPrice: number | undefined;
|
|
36
|
+
discountEndDate: string | undefined;
|
|
37
|
+
free: boolean;
|
|
38
|
+
currency: string | undefined;
|
|
39
|
+
priceText: string;
|
|
40
|
+
available: boolean;
|
|
41
|
+
offersIAP: boolean;
|
|
42
|
+
IAPRange: string | undefined;
|
|
43
|
+
androidVersion: string;
|
|
44
|
+
androidVersionText: string;
|
|
45
|
+
androidMaxVersion: string;
|
|
46
|
+
developer: string | undefined;
|
|
47
|
+
developerId: string | undefined;
|
|
48
|
+
developerEmail: string | undefined;
|
|
49
|
+
developerWebsite: string | undefined;
|
|
50
|
+
developerAddress: string | undefined;
|
|
51
|
+
developerLegalName: string | undefined;
|
|
52
|
+
developerLegalEmail: string | undefined;
|
|
53
|
+
developerLegalAddress: string | undefined;
|
|
54
|
+
developerLegalPhoneNumber: string | undefined;
|
|
55
|
+
developerInternalID: string | undefined;
|
|
56
|
+
privacyPolicy: string | undefined;
|
|
57
|
+
genre: string | undefined;
|
|
58
|
+
genreId: string | undefined;
|
|
59
|
+
categories: AppCategory[];
|
|
60
|
+
icon: string | undefined;
|
|
61
|
+
headerImage: string | undefined;
|
|
62
|
+
screenshots: string[];
|
|
63
|
+
video: string | undefined;
|
|
64
|
+
videoImage: string | undefined;
|
|
65
|
+
previewVideo: string | undefined;
|
|
66
|
+
contentRating: string | undefined;
|
|
67
|
+
contentRatingDescription: string | undefined;
|
|
68
|
+
adSupported: boolean;
|
|
69
|
+
released: string | undefined;
|
|
70
|
+
updated: number | undefined;
|
|
71
|
+
version: string;
|
|
72
|
+
recentChanges: string | undefined;
|
|
73
|
+
comments: (string | undefined)[];
|
|
74
|
+
preregister: boolean;
|
|
75
|
+
earlyAccessEnabled: boolean;
|
|
76
|
+
isAvailableInPlayPass: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Fetch the Play Store details page for an app and extract its metadata.
|
|
80
|
+
* Field paths are ported from google-play-scraper's lib/app.js MAPPINGS.
|
|
81
|
+
*/
|
|
82
|
+
declare function app(options: AppOptions): Promise<AppDetails>;
|
|
83
|
+
|
|
84
|
+
declare const BASE_URL = "https://play.google.com";
|
|
85
|
+
/** Review sort orders, matching the original google-play-scraper values. */
|
|
86
|
+
declare const sort: {
|
|
87
|
+
readonly NEWEST: 2;
|
|
88
|
+
readonly RATING: 3;
|
|
89
|
+
readonly HELPFULNESS: 1;
|
|
90
|
+
};
|
|
91
|
+
type SortValue = (typeof sort)[keyof typeof sort];
|
|
92
|
+
|
|
93
|
+
/** Base class for all errors thrown by this package. */
|
|
94
|
+
declare class PlayScraperError extends Error {
|
|
95
|
+
constructor(message: string);
|
|
96
|
+
}
|
|
97
|
+
/** Thrown when the HTTP request to Google Play fails or returns a non-2xx status. */
|
|
98
|
+
declare class PlayScraperHttpError extends PlayScraperError {
|
|
99
|
+
readonly status: number;
|
|
100
|
+
readonly url: string;
|
|
101
|
+
constructor(message: string, status: number, url: string);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Thrown when the response from Google Play cannot be parsed into the expected
|
|
105
|
+
* shape. Google Play uses an internal, undocumented protocol; when it changes,
|
|
106
|
+
* this error is the signal. The `context` field describes which part of the
|
|
107
|
+
* parse failed and includes a snippet of the offending data.
|
|
108
|
+
*/
|
|
109
|
+
declare class PlayScraperParseError extends PlayScraperError {
|
|
110
|
+
readonly context: string;
|
|
111
|
+
constructor(message: string, context: string);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface ReviewCriteria {
|
|
115
|
+
criteria: string | undefined;
|
|
116
|
+
rating: number | null;
|
|
117
|
+
}
|
|
118
|
+
interface Review {
|
|
119
|
+
id: string;
|
|
120
|
+
userName: string | undefined;
|
|
121
|
+
userImage: string | undefined;
|
|
122
|
+
date: string | null;
|
|
123
|
+
score: number | undefined;
|
|
124
|
+
scoreText: string;
|
|
125
|
+
url: string;
|
|
126
|
+
title: null;
|
|
127
|
+
text: string | undefined;
|
|
128
|
+
replyDate: string | null;
|
|
129
|
+
replyText: string | null;
|
|
130
|
+
version: string | null;
|
|
131
|
+
thumbsUp: number | undefined;
|
|
132
|
+
criterias: ReviewCriteria[];
|
|
133
|
+
}
|
|
134
|
+
interface ReviewsOptions {
|
|
135
|
+
appId: string;
|
|
136
|
+
lang?: string;
|
|
137
|
+
country?: string;
|
|
138
|
+
sort?: SortValue;
|
|
139
|
+
num?: number;
|
|
140
|
+
/** When true, make a single request and return the pagination token. */
|
|
141
|
+
paginate?: boolean;
|
|
142
|
+
/** Token from a previous paginated call to fetch the next page. */
|
|
143
|
+
nextPaginationToken?: string | null;
|
|
144
|
+
/** Custom fetch implementation. Defaults to the global fetch. */
|
|
145
|
+
fetch?: typeof fetch;
|
|
146
|
+
}
|
|
147
|
+
interface ReviewsResult {
|
|
148
|
+
data: Review[];
|
|
149
|
+
nextPaginationToken: string | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Fetch reviews for an app from Play's internal batchexecute endpoint.
|
|
153
|
+
* Request shape and response mappings are ported from google-play-scraper's
|
|
154
|
+
* lib/reviews.js (rpcid UsvDTd).
|
|
155
|
+
*/
|
|
156
|
+
declare function reviews(options: ReviewsOptions): Promise<ReviewsResult>;
|
|
157
|
+
|
|
158
|
+
export { type AppCategory, type AppDetails, type AppHistogram, type AppOptions, BASE_URL, PlayScraperError, PlayScraperHttpError, PlayScraperParseError, type Review, type ReviewCriteria, type ReviewsOptions, type ReviewsResult, type SortValue, app, reviews, sort };
|