koeri-scraper
v1.1.5
Published
Modular earthquake data scraper for Kandilli Observatory with filtering and reporting capabilities
Maintainers
Readme
KOERI Scraper
A TypeScript library and CLI tool for scraping, filtering, and reporting earthquake data from KOERI (Kandilli Observatory and Earthquake Research Institute).
Features
- 🌍 Real-time earthquake data scraping
- 🔍 Advanced filtering (location, magnitude, depth, date)
- 📊 JSON and Markdown report generation
- 💻 CLI and programmatic API
- 📝 Structured logging with color support
- ⚡ Zero runtime dependencies
Installation
npm install koeri-scraperQuick Start
Library Usage
import { createApp } from 'koeri-scraper';
const app = createApp();
// Fetch all earthquakes
await app.run();
// Filter by province and generate reports
await app.run({
province: 'IZMIR',
generateJson: true,
generateMarkdown: true
});
// Advanced filtering
await app.runWithCustomFilters({
location: { province: 'izmir', keywords: ['torbalı'] },
magnitude: { min: 2.0, max: 5.0 },
depth: { max: 10 }
});CLI Usage
# Install globally
npm install -g koeri-scraper
# Or use with npx
npx koeri-scraper
# Filter by province with JSON output
koeri-scraper --province izmir --json
# Filter by keywords with both outputs
koeri-scraper --keywords torbalı,dikili --json --markdown
# Combine filters
koeri-scraper --province izmir --keywords torbalı --json --verboseAPI Reference
createApp()
Creates a new EarthquakeApp instance.
app.run(options?)
interface AppOptions {
locationKeywords?: string[];
province?: string;
generateJson?: boolean;
generateMarkdown?: boolean;
}app.runWithCustomFilters(filterCriteria, options?)
interface FilterCriteria {
location?: { keywords?: string[]; province?: string; };
magnitude?: { min?: number; max?: number; };
date?: { start?: string; end?: string; };
depth?: { min?: number; max?: number; };
}app.getParsingStats()
Returns parsing statistics (parsed count, errors, success rate).
CLI Options
--province <name>- Filter by province--keywords <list>- Filter by keywords (comma-separated)--json- Generate JSON report--markdown- Generate Markdown report--verbose,-v- Enable verbose logging--debug- Enable debug mode--no-color- Disable colored output--help,-h- Show help
Documentation
For detailed documentation, examples, and advanced usage, see DOCS.md.
TypeScript Support
All types are fully exported:
import type { EarthquakeData, FilterCriteria, AppOptions } from 'koeri-scraper';License
MIT © Görkem Özkan
