All Episodes

November 5, 2020

Shortcuts are a delightfully powerful set of digital Lego blocks for iOS, a modern day HyperCard, in a way. This guide from Apple to creating Siri Shortcuts using web APIs prompted me to try creating one for myself, a Shortcut to retrieve the percentage of PEI’s electricity load generated from the wind.

As a starting place, I used this wind energy API endpoint, the same endpoint that my PEI Electricity web app uses. It returns real time data about wind energy load and generation on Prince Edward Island, like this:

{
  "current": {
    "updatetime": "2020-11-05 12:59:00",
    "uptimetimehuman": "Thursday at 12:59 PM",
    "on-island-load": "202.86",
    "on-island-wind": "163.86",
    "on-island-fossil": "0.00",
    "wind-local": "77.98",
    "wind-export": "85.88",
    "percentage-wind": "80.77"
  },
  "previous": {
    "updatetime": "2020-11-05 12:44:00",
    "uptimetimehuman": "Thursday at 12:44 PM",
    "on-island-load": "202.80",
    "on-island-wind": "164.65",
    "on-island-fossil": "0.00",
    "wind-local": "77.36",
    "wind-export": "87.29",
    "percentage-wind": "81.19"
  },
  "peak": {
    "peak": "213",
    "hightime": "10:14 AM"
  },
  "peakwind": {
    "peak": "179",
    "hightime": "8:29 AM"
  }
}

That’s got everything I need in an endpoint to make a Shortcut: I want the Shortcut to use the “percentage-wind” value, 80.77 in this example.

To create the Shortcut, I launched the Shortcuts app on my iPhone, tapped the “+” to create a new one, gave it the name “what’s the wind energy,” and then added my first action, a Get Contents of URL action to get the contents of that endpoint:

Screen shot from iPhone showing a "Get contents of" action in the Shortcuts app, along with the URL of the API endpoint

Next, a Get Dictionary Value action, as I needed to pull out just the value for percentage wind energy generation, using simple dot notation for current.percentage-wind:

Screen shot from iPhone showing a "Get Dictionary Value" action in the Shortcuts app, along with value I want to retrieve

Because that’s returned as a decimal value, and I didn’t need that much granularity, I rounded off the value using a Round Number action:

Screen shot from iPhone showing a "Round Number" action in the Shortcuts app.

I added the words “per cent” using a Text action:

Screen shot from iPhone showing a "Text" action in the Shortcuts app.

Finally, I added a Speak Text action to read the result:

Screen shot from iPhone showing a "Speak Text" action in the Shortcuts app.

With the Shortcut saved, I can say “hey siri, what’s the wind energy” to my iPhone and it tells me.

You

Mark as Played

Advertise With Us

Popular Podcasts

Stuff You Should Know
Crime Junkie

Crime Junkie

Does hearing about a true crime case always leave you scouring the internet for the truth behind the story? Dive into your next mystery with Crime Junkie. Every Monday, join your host Ashley Flowers as she unravels all the details of infamous and underreported true crime cases with her best friend Brit Prawat. From cold cases to missing persons and heroes in our community who seek justice, Crime Junkie is your destination for theories and stories you won’t hear anywhere else. Whether you're a seasoned true crime enthusiast or new to the genre, you'll find yourself on the edge of your seat awaiting a new episode every Monday. If you can never get enough true crime... Congratulations, you’ve found your people. Follow to join a community of Crime Junkies! Crime Junkie is presented by audiochuck Media Company.

24/7 News: The Latest

24/7 News: The Latest

The latest news in 4 minutes updated every hour, every day.

Music, radio and podcasts, all free. Listen online or download the iHeart App.

Connect

© 2025 iHeartMedia, Inc.