Dark Sky automation question

I’d like to create an ios shortcut that would look over the next 10 days and tell me what days are good bicycling days in my current location. For example, wind speed needs to be less than 10 mph, sunny, and temp greater than 60 degrees F.

I would like to display a list of the days that meet the criteria and the actual values of the wind speed, temperature, cloud conditions.

I’ve never created a shortcut before, but I know how to program and understand the concepts of conditions and loops, etc. If anyone can layout the basic concepts I’d be using to achieve what I’m wanting to do, that would be great. Thanks!

Here is a quick framework that you can build from. It shows how to get to the DarkSky data. Of course, you would need to add the conditional logic for testing for your max wind speed, etc. Hopefully this gets you started.

If you need more guidance, let us know. — jay



Wow, this is great! I really appreciate your help with this! Fantastic!


Of course! Post again if you get stuck

As a fellow cyclist, I appreciate your objective!

On a related note, I have a half finished shortcut/scriptable app that takes GPX track data from a planned route and produces weather at location every 30 minutes based on a planned start time and a projected average speed. This was motivated by the day we’ve all add when the weather looked great and I got about an hour in and the heavens opened up on me!

It mostly works. I need to carve out some time to get it finished. I think it would be really useful. Would be a great add-in to apps like Ride with GPS or EasyRoute.

That’s great! What a good idea. My wife and I are just getting started in recreational biking. We need the exercise. Plan on hitting the paved bike trails that run throughout Ohio.

I did put on my API key for Dark Sky and ran the script framework you gave just to try it out (without conditions, loops, etc.)

I got the following error (see the pic). Any ideas?

Just to be sure, in the dark sky URL, when you put in your API key, you removed the square brackets, too?

The URL should look something like this:


If you did do that, I suggest adding a QuickLook action immediately after the Get Contents of URL action. You should see a return payload of data or perhaps an error message. Try that and report back.

1 Like

After I put in the Quick Look as you suggested I saw this error.

I have location services turned on an it gives permission for Shorcuts app


My url I the following

https://api.darksky.net/forecast/(MyKey)/Current Location (Latitude),Current Location (Longitude

(MyKey) is replaced by my key

The URL should look like this. No other characters eg, no “(“

Is this the construct you are using?


I suggest adding a quick look action right after the URL action to make sure the URL is being formed correctly.

This is what Quick Look displays when inserted immediately after the URL step. Your URL should look similar in construct.

Ok so I’m assuming there is a a way for me to automatically get the current lat, long using another function within Shortcuts. I want it to look at weather wherever I currently am located.

Yes, there is… Get Current Location. See the original shortcut example I linked to above. That Shortcut includes that action and demonstrates how you reference its values in the Dark Sky URL.

1 Like

The problem is get current location actually returns an address and not the latitude and longitude. I have to use get location details apparently

You should be able to use the Get Details of Location to pass you long/lat values that you can plug into the api.

1 Like

If you look at the original shortcut example I posted, it shows how to reference the lat and long from the Get Current Location action. You should be able to use that exact shortcut, only putting in your API key.

here’s a simple screen capture that demonstrates how to access the attributes of the Get Current Location action. I hope this helps clarify


Ok. I Apologize for all the questions. I guess I wish there was better documentation on how to use this stuff. Granted it’s still pretty new. Thank you again.

Sometimes the documentation is hidden, and other times you write your own. In this case, it’s both.

They can’t write documentation to fit all scenarios. However, they do write documentation for each individual component. Tapping the info icon before you add it to your Shortcuts shows what the component does and accepts as input and what it outputs. Once added to the Shortcut, you can bring that back up by tapping on the icon for the component.

Sometimes, it’s easier to write the documentation for what you want to achieve on paper then go searching for the proper pieces to fit what you’ve outlined.

Seems like you’re doing great though. Keep it up!

Have you tried using the built in weather functions? These were significant enhanced in version 2.1 as we mentioned on the podcast recently.



That would certainly be a simpler start, IF the future forecast included wind speed. Unfortunately, the new capability does not include that attribute in the forecast data. At least in my experiments

Thank you all for your responses! Very helpful! Rosemary, how ironic you responded to this because I was just listening to your interview on the day one podcast.

I have wind speed here :wink:
It’s in my example :slight_smile:

1 Like