Earthquake Monitor

πŸŒ‹ Real-time earthquake monitoring for China, Taiwan, and Japan. CENC/CWA/JMA data with proactive alerting. v1.1.1 - Multi-language (zh/en/ja), pinyin location matching, optimized cache

Audits

Pass

Install

openclaw skills install earthquake-monitor

πŸŒ‹ Earthquake Monitor v1.1.1

Real-time earthquake monitoring for China (CENC), Taiwan (CWA), and Japan (JMA) with proactive alerting.

v1.1.1 Changelog

v1.1.1 (Security Fix)

  • πŸ”’ Security Update - Removed encryption for ClawHub compatibility
  • πŸ“ Added SECURITY.md documentation

v1.1.0 Features

  • 🌍 Multi-language Support - Alert messages in Chinese, English, and Japanese
  • πŸ“ Location Fuzzy Matching - Supports pinyin (dali), abbreviations (DL), partial match (da)
  • ⚑ Performance Optimization - Shared cache module with auto-cleanup
  • βœ… Fixed Taiwan (CWA) data source integration
  • βœ… Improved notification deduplication logic

Quick Start

// Initialize monitoring
await init({ location: "倧理" })

// Get latest earthquakes
await getAll()

// Start proactive monitoring
await start()

Data Sources

SourceRegionLanguage (Alert)Description
CENCπŸ‡¨πŸ‡³ ChinaδΈ­ζ–‡China Earthquake Networks Center
CWAπŸ‡ΉπŸ‡Ό TaiwanδΈ­ζ–‡Central Weather Administration
JMAπŸ‡―πŸ‡΅ Japanζ—₯本θͺžJapan Meteorological Agency

API Reference

init(options)

Initialize configuration.

await init({
  location: "dali",           // City name (supports pinyin, abbreviations)
  distanceThreshold: 300,     // Alert distance in km
  minMagnitude: 3.0,         // Minimum magnitude
  language: 'zh',            // Language: zh/en/ja
  sources: {                // Toggle data sources
    CENC: true,
    JMA: true,
    CWA: true
  }
})

getAll(options)

Get earthquakes from all sources.

const result = await getAll({ limit: 5 })
// Returns: { earthquakes, totalCount, nearbyEarthquakes, hasAlert, alertMessage }

getCENC(limit)

Get China earthquake data.

const { earthquakes } = await getCENC(10)

getJMA(limit)

Get Japan earthquake data.

const { earthquakes } = await getJMA(10)

getCWA()

Get Taiwan earthquake early warning data.

const { earthquakes, isWarning } = await getCWA()

start(options)

Start proactive monitoring with auto-alerts.

await start({ interval: 60000 })  // Check every 60 seconds

stop()

Stop monitoring.

await stop()

config(newConfig)

View or update configuration.

// View
const cfg = await config()

// Update
await config({ language: 'en', minMagnitude: 4.0 })

cities()

List all supported cities with coordinates.

const { cities } = await cities()

Configuration Options

OptionTypeDefaultDescription
locationstring/object倧理City name or {name, latitude, longitude}
distanceThresholdnumber300Alert distance in km
minMagnitudenumber3.0Minimum earthquake magnitude
languagestringzhAlert language: zh/en/ja
sources.CENCbooleantrueEnable China data
sources.JMAbooleantrueEnable Japan data
sources.CWAbooleantrueEnable Taiwan data
webhookstringnullEncrypted webhook URL

Supported Cities (20+)

CityPinyinAbbrCoordinates
倧理dali, dal, dlDL25.61Β°N, 100.27Β°E
εŒ—δΊ¬beijing, bj, bBJ39.90Β°N, 116.40Β°E
上桷shanghai, sh, sSH31.23°N, 121.47°E
ζ˜†ζ˜Žkunming, km, kKM25.04Β°N, 102.71Β°E
ζˆιƒ½chengdu, cd, cCD30.57Β°N, 104.07Β°E
东京tokyo, dj, dDJ35.68°N, 139.69°E
............

Location Matching Examples

All these return Beijing:

await init({ location: 'εŒ—δΊ¬' })      // Chinese
await init({ location: 'beijing' })   // Full pinyin
await init({ location: 'bj' })        // Abbreviation
await init({ location: 'bei' })       // Partial match

Multi-Language Alerts

Alert language is automatically selected based on earthquake source:

SourceLanguageExample
CENC (China)δΈ­ζ–‡βš οΈ εœ°ιœ‡ι’„θ­¦ζι†’οΌ
CWA (Taiwan)δΈ­ζ–‡βš οΈ εœ°ιœ‡ι’„θ­¦ζι†’οΌ
JMA (Japan)ζ—₯本θͺžβš οΈ εœ°ιœ‡γ‚’γƒ©γƒΌγƒˆοΌ

Manual Language Override

// Set preferred language (applies to alert format)
await init({ language: 'en' })

// All alerts will be in English regardless of source

Alert Message Format

⚠️ Earthquake Alert!
πŸ“ Epicenter near Dali:

1. πŸ”΄ M7.6ηΊ§ [δΈ­ε›½εœ°ιœ‡ε°η½‘]
   πŸ“ ζ±€εŠ ηΎ€ε²›
   πŸ“ Distance: 5000km
   ⏰ 2026-03-24 12:37:50
   πŸ“Š Depth: 250km

Please stay safe!

Security

Webhook URLs are encrypted using AES-256-CBC before storing in config file:

// Set webhook (automatically encrypted)
await config({ webhook: 'https://oapi.dingtalk.com/robot/send?access_token=xxx' })

// Stored encrypted, decrypted only in memory

Performance

Shared Cache

  • Reduces redundant API calls
  • TTL-based expiration (1 minute default)
  • Auto-cleanup every 5 minutes

Parallel Fetching

  • All three data sources fetched simultaneously
  • Fast response time

Return Format

{
  timestamp: "2026-03-24T14:30:00.000Z",
  sources: [
    { source: "CENC", sourceName: "δΈ­ε›½εœ°ιœ‡ε°η½‘", count: 10, earthquakes: [...] },
    { source: "JMA", sourceName: "ζ—₯ζœ¬ζ°”θ±‘εŽ…", count: 5, earthquakes: [...] }
  ],
  earthquakes: [...],      // Merged, sorted by time
  totalCount: 15,
  nearbyEarthquakes: [...], // Within distanceThreshold
  hasAlert: true/false,
  alertMessage: "..."       // Formatted alert string
}

Notes

  • 🌐 Data from official government agencies (CENC/CWA/JMA)
  • πŸ”‘ No API key required
  • πŸ“‘ WebSocket + HTTP fallback
  • πŸ”„ Auto-retry on failure

Support