Menu
KC8JC
  • About KC8JC
KC8JC
A screenshot of a Python script for querying the POTA API.

Simple POTA Hunter Script

Posted on February 2, 2023 by KC8JC

I found myself poking at the POTA APIs yesterday and decided that it’d be neat to bang out a quick script that might tell me from a CLI (or over my Mac notifications) whether or not a state that I’m hunting on FT8 is on the air. The API is simple enough. So why not?

I quickly installed Python (not sure why it wasn’t on my Mac anymore, but…OK?) and did a bit of reading on the JSON library. Pretty simple. With a timeline of 20 free minutes, I banged out the following:

import json
import requests
import os

response = requests.get("https://api.pota.app/spot/activator")
spots = json.loads(response.text)

my_targets = ["US-DE", "US-HI", "US-ID", "US-LA", "US-VT"] 

for spot in spots:
   if spot["mode"] == "FT8":
      if spot["locationDesc"] in my_targets:
         my_cmd = """osascript -e 'display notification \"""" + spot["locationDesc"] + """\" with title \"GOT A LIVE ONE!\"'"""
         os.system(my_cmd)
         print('')
         print('***********************************************')
         print('***  ' + spot["activator"] +' - ' + spot["mode"] + ' - ' + spot["locationDesc"] + ' - ' + spot["reference"] + ' - ' + spot["frequency"])
         print('***********************************************')
         print('')
      else:
         print(spot["activator"] + ' - ' + spot["locationDesc"])

A few things to note. my_targets aren’t the same as anyone else’s. I’m just banging away trying to get Delaware, Hawaii, Idaho, Louisiana, and Vermont. The targets could really be anything anywhere. So that’s neat. I can switch that up and poke around if I’m trying to find some rare DX.

Another thing to note is that Alaska isn’t in my_targets because as soon as I’d finished the script, it found that a station in Alaska at Quartz Lake State Recreation Area – K-7237 was on 10m and I nabbed him! Thanks KL7AC!

This script is not particularly well tested and the osascript piece will only work on a Mac. But the rest of it? It could be dumped into a cron job (my plan) and used to message someone (maybe).

I’m sure there are better tools for this. I’m also sure that I didn’t really spend any time looking for them because I had 20 minutes and an itch to solve this while it was in front of me. Probably not gonna put this up on Git but I will leave it here.

1 thought on “Simple POTA Hunter Script”

  1. Pingback: CW Code Study Hack with POTA Activator Data? – KC8JC

Comments are closed.

Log in

  • About KC8JC

Recent Posts

  • The First Bike Activation of 2023
  • cw100days
  • Resetting the Field Tablet
  • Get To The Park When The Sun Is Out
  • RadioMail and Mobilinkd TNC4 – A Success Story
Fediverse.Radio Web Ring

← Back ↓ Ring Home Next →

↑ Random

Categories

  • Administrative (1)
  • Antennas (3)
  • Bad Software (2)
  • Bags (2)
  • Bike Portable (1)
  • Camping (4)
  • Club Events (6)
  • Computers (7)
  • Contesting (6)
  • CW (4)
  • D-STAR (3)
  • Deep Thoughts (7)
  • FCC (1)
  • Field Work (60)
  • FT8 (58)
  • Gear (15)
  • Goals (7)
  • Hardrock50 (3)
  • Hobby Of Hobbies (8)
  • IC-705 (62)
  • IC-7100 (2)
  • Jeep (8)
  • JOTA (2)
  • Kit Building (2)
  • Mac (1)
  • Mobile (1)
  • OSPOTA (2)
  • Packet Radio (1)
  • Portable (55)
  • POTA (48)
  • Scouts (1)
  • Software (4)
  • Special Event (2)
  • TH-D74 (2)
  • Tricks (1)
  • Uncategorized (16)
  • Winlink (4)
  • X6100 (3)
©2023 KC8JC | WordPress Theme by Superb Themes