connect to the nation PNW api code example
Example: how do i connect to the nation api on PNW
import requests, json
nationID = "nationID you want data on"
apikey = "Your PNW api key (found on the account page)"
nationreq = requests.get(f"https://politicsandwar.com/api/nation/id={nationID}&key={apikey}")
nationreq = nationreq.json()
print(nationreq)
cityids = nationreq["cityids"]
nationid = nationreq["nationid"]
nation_name = nationreq["name"]
nation_prename = nationreq["prename"]
uniqueid = nationreq["uniqueid"]
print(f"{cityids} {nationid} {nation_name} {nation_prename} {uniqueid}")