Skip to content

Instantly share code, notes, and snippets.

@jeffehobbs
jeffehobbs / get_wk_token.py
Last active February 1, 2024 20:24
Get ADC WeatherKit token for REST API
# get_wk_token.py // [email protected] // Nov. 2022
# from documentation here, which you should read first:
# https://developer.apple.com/documentation/weatherkitrestapi/request_authentication_for_weatherkit_rest_api
#
# 1. Have a valid ADC acount. https://developer.apple.com
# 2. Download this script, and open it in a text editor. You'll have to change three variables.
# 3. Make up a reverse-domain name service ID (i.e., com.domain.app). Place this in SERVICE_ID.
# 4. Create an ADC service identifier. https://developer.apple.com/account/resources/identifiers/add/bundleId
# 5. Create an ADC service key. https://developer.apple.com/account/resources/authkeys/add
# 6. Download that service key, rename to 'wkservicekey.p8', and move it into same directory as this script.