Pollen Mobile Scraper
A simple script to scrape Pollen Mobile data into a Postgres Database. This can be used as a cron script to keep an up-to-date copy for your own custom frontend or scripts.
This requires Go 1.18+ installed. After you clone the repository, running it is simple:
go run main.go
Optionally, if you want to also sync certain geographic hexes, you can list them:
go run main.go "852a1393fffffff,852a104bfffffff,852a1057fffffff" "85283457fffffff,852830c7fffffff,85283467fffffff"
The script populates 3 tables:
pollen_rewards. Each stores representative information from the API, along with canonical IDs to join against tables.
Here are a few H3 Hex Bounding Boxes I’ve been using:
|Area||Hex Bounding Box|
|New York City||
Most Profitable Hexes in a Given Area
SELECT id, flower_count, bounty_reward, loot_box_reward, daily_reward FROM pollen_hexes WHERE suburb = 'Brooklyn' ORDER BY 3 DESC LIMIT 10;
Daily Rewards By Type
SELECT date, reward, SUM(PCN) FROM pollen_rewards WHERE date >= '2022-09-10' GROUP BY 1,2 ORDER BY 1 DESC, 2 ASC LIMIT 10
Top Flower Locations
SELECT COALESCE(city, town, county, suburb) AS location, COUNT(1) FROM pollen_flowers GROUP BY 1 ORDER BY 2 DESC LIMIT 10