Gathering detailed insights and metrics for storescraper-ai
Gathering detailed insights and metrics for storescraper-ai
Gathering detailed insights and metrics for storescraper-ai
Gathering detailed insights and metrics for storescraper-ai
npm install storescraper-ai
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
StoreScraper AI CLI is a powerful command-line tool for fetching, analyzing, and processing app reviews from Google Play Store and Apple App Store. It helps developers, product managers, and market researchers gain valuable insights from user feedback through AI-powered analysis.
The tool solves several key problems:
This tool is aimed at:
StoreScraper AI CLI is built with a modular architecture that separates concerns into distinct components:
Command Layer (src/commands/
)
Scraper Layer (src/utils/store-scraper.ts
)
AI Layer (src/ai/
)
Settings Layer (src/utils/settings.ts
)
User Input → Command Layer → Scraper Layer → Data Processing → AI Analysis → Output Generation
1npm install -g nanogiants-storescraper-ai
1npm install nanogiants-storescraper-ai
You can use this package as a library in your Node.js, React, or NestJS applications:
1import { StoreScraper } from 'nanogiants-storescraper-ai'; 2 3// Initialize with configuration 4const scraper = new StoreScraper({ 5 openai: { 6 apiKey: 'your-openai-api-key', // Required for AI features 7 model: 'gpt-4-turbo' // Optional, defaults to gpt-4-turbo 8 }, 9 defaultLanguage: 'en', 10 defaultCountry: 'us', 11 defaultReviewCount: 50 12}); 13 14// Example: Fetch app info and reviews from Google Play 15async function getAppInfo() { 16 try { 17 // Fetch app info and reviews 18 const appInfo = await scraper.fetchGooglePlayApp('com.example.app', { 19 reviewCount: 100, 20 lang: 'en', 21 country: 'us' 22 }); 23 24 console.log(`App: ${appInfo.title}`); 25 console.log(`Rating: ${appInfo.score}`); 26 console.log(`Reviews: ${appInfo.reviews.length}`); 27 28 // Analyze reviews with AI 29 const analysis = await scraper.analyzeFeedback( 30 appInfo.reviews.map(review => review.text), 31 'english' 32 ); 33 34 console.log('Analysis:', analysis); 35 36 // Example: Bulk analysis of multiple apps from a CSV file 37 const csvString = `Name;App Id;Mobile App Name 38Company A;com.company.app;App Name 39Company B;com.company.app2;App Name 2`; 40 41 const result = await scraper.analyzeBulkFeedback(csvString, { 42 outputPath: './output', 43 platform: 'android', 44 reviewCount: 50, 45 language: 'en', 46 country: 'us', 47 generateDetailedReports: true 48 }); 49 50 console.log(`Summary CSV saved to: ${result.summaryFilePath}`); 51 console.log(`Processed ${result.summaryData.length} apps successfully.`); 52 53 // Example: Validate Excel file before parsing 54 const validationResult = scraper.validateTamExcel('./path/to/excel-file.xlsx'); 55 56 if (!validationResult.isValid) { 57 console.error(`Error: ${validationResult.error}`); 58 console.log('Available columns:', validationResult.columnNames.join(', ')); 59 return; 60 } 61 62 console.log('Excel file is valid!'); 63 console.log(`Name column: ${validationResult.nameColumn}`); 64 console.log(`App column: ${validationResult.appColumn}`); 65 if (validationResult.appNameColumn) { 66 console.log(`App name column: ${validationResult.appNameColumn}`); 67 } 68 69 // Example: Parse Excel file to extract app IDs 70 const parseResult = await scraper.parseTam('./path/to/excel-file.xlsx', { 71 outputPath: './output', 72 verbose: true 73 }); 74 75 console.log(`Extracted ${parseResult.count} app IDs`); 76 console.log(`Output saved to: ${parseResult.outputPath}`); 77 78 // Access the extracted app data 79 parseResult.data.forEach(app => { 80 console.log(`${app.Name} - ${app['App Id']} (${app['Mobile App Name']})`); 81 }); 82 } catch (error) { 83 console.error('Error:', error); 84 } 85} 86 87getAppInfo();
1import { useState, useEffect } from 'react'; 2import { StoreScraper } from 'nanogiants-storescraper-ai'; 3 4function AppAnalyzer() { 5 const [appInfo, setAppInfo] = useState(null); 6 const [loading, setLoading] = useState(false); 7 const [error, setError] = useState(null); 8 9 // Initialize scraper (preferably in a service or context) 10 const scraper = new StoreScraper({ 11 openai: { 12 apiKey: process.env.REACT_APP_OPENAI_API_KEY 13 } 14 }); 15 16 async function analyzeApp(appId) { 17 setLoading(true); 18 try { 19 const info = await scraper.fetchGooglePlayApp(appId); 20 setAppInfo(info); 21 } catch (err) { 22 setError(err.message); 23 } finally { 24 setLoading(false); 25 } 26 } 27 28 return ( 29 <div> 30 {/* Your UI components */} 31 </div> 32 ); 33}
1import { Injectable } from '@nestjs/common'; 2import { StoreScraper } from 'nanogiants-storescraper-ai'; 3import { ConfigService } from '@nestjs/config'; 4 5@Injectable() 6export class AppAnalysisService { 7 private scraper: StoreScraper; 8 9 constructor(private configService: ConfigService) { 10 this.scraper = new StoreScraper({ 11 openai: { 12 apiKey: this.configService.get<string>('OPENAI_API_KEY') 13 } 14 }); 15 } 16 17 async analyzeApp(appId: string, platform: 'android' | 'ios') { 18 if (platform === 'android') { 19 return this.scraper.fetchGooglePlayApp(appId); 20 } else { 21 return this.scraper.fetchAppStoreApp(appId); 22 } 23 } 24 25 async getFeedbackAnalysis(reviews: string[]) { 26 return this.scraper.analyzeFeedback(reviews); 27 } 28 29 async validateExcelFile(filePath: string) { 30 return this.scraper.validateTamExcel(filePath); 31 } 32 33 async parseExcelFile(filePath: string) { 34 // First validate the Excel file 35 const validationResult = await this.validateExcelFile(filePath); 36 37 if (!validationResult.isValid) { 38 throw new Error(`Invalid Excel file: ${validationResult.error}`); 39 } 40 41 // Then parse the Excel file 42 return this.scraper.parseTam(filePath, { 43 outputPath: './output/tam', 44 verbose: false 45 }); 46 } 47} 48 49### Local Installation 50 51```bash 52git clone https://github.com/nanogiants/storescraper-ai.git 53cd storescraper-ai 54npm install 55npm link
This package requires an OpenAI API key for AI analysis features. There are several ways to provide this:
Environment Variables: Set the OPENAI_API_KEY
environment variable
1export OPENAI_API_KEY=your_api_key_here
Dotenv File: Create a .env
file in your project root with your API key
OPENAI_API_KEY=your_api_key_here
Settings Command: Use the settings command to save your API key
1storescraper settings
When using as a library, you must provide the API key in the configuration:
1const scraper = new StoreScraper({ 2 openai: { 3 apiKey: 'your_api_key_here' 4 } 5});
For security best practices:
Check out the examples directory for complete working examples of how to use this package programmatically:
Create a .env
file in the root directory with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
Fetch and analyze reviews for a single app:
1storescraper feedback [options]
Options:
-p, --platform <platform>
: Specify platform (android or ios)-c, --count <count>
: Number of reviews to fetch (default: 50)-o, --output <path>
: Output directory for the markdown file-l, --lang <lang>
: Two letter language code (default: en)-C, --country <country>
: Two letter country code (default: us)-s, --sort <sort>
: Sort reviews by: newest, rating, or helpful (default: newest)-a, --analyze <boolean>
: Analyze feedback with AI after fetching (true/false)Example:
1storescraper feedback -p android -c 100 -l de -C de -s newest -a true -o my-app
Output:
Process multiple apps from a CSV file:
1storescraper feedback-bulk [options]
The command includes an interactive file picker that allows you to:
Options:
-i, --input <path>
: Path to the input CSV file with app IDs-c, --count <number>
: Number of reviews to fetch (default: 50)-l, --lang <code>
: Two letter language code (default: en)-C, --country <code>
: Two letter country code (default: us)-s, --sort <sort>
: Sort reviews by: newest, rating, or helpful (default: newest)-a, --analyze <boolean>
: Analyze feedback with AI after fetching (true/false)-o, --output <path>
: Output directory for the markdown files-d, --delay <ms>
: Delay between requests in milliseconds (default: 1000)Example:
1storescraper feedback-bulk -i app-ids.csv -c 50 -l en -C us -a true -d 2000 -o output
Input CSV Format:
Name;App Id;Mobile App Name
App Name 1;com.example.app1;App Display Name 1
App Name 2;123456789;App Display Name 2
Output:
Extract app IDs from Excel files containing app URLs:
1storescraper parse-tam [options]
Options:
-i, --input <path>
: Path to the input Excel file or directory-o, --output <path>
: Path to save the output CSV file(s)-d, --delimiter <char>
: Delimiter for the output CSV file (default: ;)-v, --validate-only
: Only validate the Excel file without parsing (default: false)Example:
1storescraper parse-tam -i tam-data.xlsx -o output 2storescraper parse-tam -i tam-directory -o output 3storescraper parse-tam -i tam-data.xlsx -v # Validate only
Expected Excel format:
The command will first validate the Excel file to ensure it has the required columns. If validation fails, it will display the available columns and suggest possible matches.
Output CSV format:
Analyze existing review text:
1storescraper analyze [options]
Options:
-f, --file <path>
: Path to file containing feedback to analyze-o, --output <path>
: Path to save the analysis results-l, --language <language>
: Language for the analysis output (e.g., english, german, spanish)Example:
1storescraper analyze -f reviews.txt -o analysis.md -l german
Configure default settings:
1storescraper settings [options]
Options:
-r, --reset
: Reset settings to default valuesAll output is saved in the output
directory by default, with the following structure:
output/
├── app-name-1/
│ ├── App-Name-1-android-timestamp.md # Reviews
│ └── analysis-timestamp.md # AI analysis
└── app-name-2/
├── App-Name-2-ios-timestamp.md # Reviews
└── analysis-timestamp.md # AI analysis
Clone the repository:
1git clone https://github.com/nanogiants/storescraper-ai.git 2cd storescraper-ai
Install dependencies:
1npm install
Create a local environment file:
1cp .env.example .env 2# Edit .env and add your OpenAI API key
Build the project:
1npm run build
Link the package locally:
1npm link
├── dist/ # Compiled JavaScript files
├── src/ # Source TypeScript files
│ ├── ai/ # AI-related functionality
│ │ ├── core/ # Core AI utilities
│ │ └── usecases/ # AI use cases
│ ├── commands/ # CLI commands
│ └── utils/ # Utility functions
├── output/ # Generated output files (gitignored)
├── .env # Environment variables
└── tsconfig.json # TypeScript configuration
src/commands
directory.src/ai/usecases
directory.src/utils/store-scraper.ts
.src/utils/settings.ts
.src
directory.npm run build
.npm link
and running the CLI commands.This project follows the Karma commitlint style for commit messages:
<type>(<scope>): <subject>
Types:
Example:
feat(feedback): add support for custom output formats
src/commands/
(e.g., my-command.ts
).src/index.ts
.Example:
1// src/commands/my-command.ts 2import { Command } from 'commander'; 3 4export function initMyCommand(program: Command): void { 5 program 6 .command('my-command') 7 .description('Description of my command') 8 .option('-o, --option <value>', 'Description of option') 9 .action(async (options) => { 10 // Command implementation 11 }); 12} 13 14// src/index.ts 15import { initMyCommand } from './commands/my-command'; 16// ... 17initMyCommand(program);
src/ai/usecases/
(e.g., my-usecase.ts
).UseCase
class.Example:
1import { z } from 'zod'; 2import { UseCase, UseCaseConfig } from '../core/usecase'; 3 4const MyResponseSchema = z.object({ 5 // Define your schema 6}); 7 8export type MyResponse = z.infer<typeof MyResponseSchema>; 9 10const myUsecaseConfig: UseCaseConfig<MyResponse> = { 11 name: 'My Usecase', 12 description: 'Description of my usecase', 13 schema: MyResponseSchema, 14 temperature: 0.2, 15}; 16 17export class MyUsecase extends UseCase<MyResponse> { 18 constructor() { 19 super(myUsecaseConfig); 20 } 21 22 async execute(input: string): Promise<MyResponse> { 23 return this.execute(input); 24 } 25}
When working with OpenAI's API and Zod schemas, note that OpenAI's implementation doesn't support certain Zod validation fields:
Instead, include validation guidance in the description field.
1git flow release start <version>
1git flow release finish <version>
1git push origin master --tags
1npm publish
parse-tam
command to extract app IDs from Excel filesfeedback-bulk
command to process multiple apps from a CSV fileContributions are welcome and appreciated! Here's how you can contribute:
Before submitting a pull request, please ensure:
Bug reports and feature requests are welcome on GitHub at https://github.com/nanogiants/storescraper-ai. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
MIT License Copyright (c) 2025 NanoGiants GmbH
Permission is hereby granted, free
of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice
(including the next paragraph) shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
API Rate Limiting
-d
option-c
OpenAI API Errors
CSV Parsing Issues
;
)Excel Parsing Issues
If you encounter issues not covered here, please open an issue on GitHub with:
No vulnerabilities found.
No security vulnerabilities found.