WolframAlphaKit is an iOS shortcut that acts as something akin to a library, allowing your own shortcuts to:
- perform a query against WolframAlpha;
- optionally parse the response using your own custom JSONPath so you can retrieve additional details (e.g. images);
- guide the user through the process of entering their existing WolframAlpha API key, or signing up for a new one.
WolfraAlpha has a free tier that allows for up to 2,000 queries a month. As it's a paid service, each user needs to sign up for their own key.
The shortcut can be installed from the following link:
When your Shortcut calls WolframAlphaKit, it first checks to see if you have an API Key.
If you have an API key, it performs your query and returns you the result.
If the user does not have a key, they are asked if they want to:
- Sign up for an API key
- Enter their existing API key
The Shortcut will then guide the end user through the process of signing up and / or entering their key.
Once added, the end user can make use of any shortcut that uses WolframAlphaKit to query the WolframAlpha service without having to re-enter their API key.
An example of a user making using a WolframAlphaKit based shortcut for the first time
To query WolframAlphaKit, you need to create a Dictionary with the following keys and value:
Key | Value |
---|---|
action | query |
input | Your WolframAlpha Query (e.g. Population of New York ) |
jsonPath (optional) | The JSON path query used to return the result from the API response. |
For those familiar the API response:
By default, WolframAlphaKit takes the
plaintext
subpods values from theResult
pod.
You then run the WolframAlphaKit shortcut with the Dictionary as the input:
It returns a dictionary with exitCode
and result
values.
Key | Value |
---|---|
exitCode | Returns 0 for a success response or > 0 for an error. |
result | The result of your query |
A shortcut template can be installed from the following link:
A shoutout goes to Mike Beasley whose work on the UpdateKit shortcut inspired me to work on this project.