Passing parameters in URL

Hi ,

I am trying to fetch weather data for a specified latitude and longitude. Below is the url which gives that.

https://api.darksky.net/forecast//37.8267,-122.4233

How to pass the lat and lon value which are separated by comma in the URL.

I am using Tyq cloud to create my API.

Thanks.

Hi,

You can use the path used in the DarkSky API when access the API via Tyk too.

For example, if you define your API upstream target as https://api.darksky.net/, and have an API slug as weather, then you can access it through the Tyk Cloud as http://<your-org>.cloud.tyk.io/weather/forecast/37.8267,-122.4233.

Tyk will identify the API by the weather element of the path, then take the remaining of the path forecast/37.8267,-122.4233 and add that to the target URL to make https://api.darksky.net/forecast/37.8267,-122.4233.

Regards,
Dave

Thanks David. It worked like a charm.