← Public packages
@reng/pollen
Pollen index / levels for a city or lat/lon via Open-Meteo Air Quality API (zero OAuth).
AGENTS.md
47 lines · 1.5 KB · Markdown@reng/pollen
Imports
import { getPollen } from 'kody:@reng/pollen'
import { getPollen as getPollenNamed } from 'kody:@reng/pollen/getPollen'Root export re-exports getPollen and offers a callable default with the same { location?, latitude?, longitude?, hours? } input.
Smoke tests
import { getPollen } from 'kody:@reng/pollen'
const berlin = await getPollen({ location: 'Berlin', hours: 12 })
// expect coverage === 'available' (Europe) and levels keys among alder/birch/grass/mugwort/olive/ragweed
const shanghai = await getPollen({ location: 'Shanghai', hours: 6 })
// expect coverage === 'unavailable' and empty levels (CAMS pollen is Europe-focused)App smoke:
import { kody } from 'kody:runtime'
await kody.packageAppFetch({ kody_id: 'pollen', path: '/' })
// expect status 200 and HTML body
await kody.packageAppFetch({
kody_id: 'pollen',
path: '/api/getPollen',
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ location: 'Berlin', hours: 6 }),
})Edge cases
- Missing both
locationand lat/lon throws. - Unknown place name throws (
Place not found). - Outside Europe (e.g. Shanghai): API returns null pollen series →
coverage: "unavailable", emptylevels, explanatorysummary. - Labels (
none/low/moderate/high/very_high) are a simple grains/m³ heuristic, not clinical thresholds. - Hosted app links must use
packageContext.hostedUrl+appBasePath. - Zero secrets; plain
fetchonly.