empty results

  • 1
  • Problem
  • Updated 2 years ago
When I try to get the current conditions using the following URL, the result json has only the following contents.

http://api.wunderground.com/api/myKey/geolookup/conditions/lan:EN/pws:1/bestfct:1/q/India...

@{response=; location=; current_observation=}

I am invoking this request using powershell script as $weather_info=Invoke-RestMethod url.

Am I missing something?
Photo of Madhan

Madhan

  • 3 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Радик Комиссаров

Радик Комиссаров

  • 1 Post
  • 0 Reply Likes
You meet the description: this key does not exist "
http://api.wunderground.com/api/<b><u>myKey???</u></b>
(Edited)
Photo of Madhan

Madhan

  • 3 Posts
  • 0 Reply Likes
I do not get any error or description mentioned, as I have used the provided key. I have given myKey as a sample.
Photo of Madhan

Madhan

  • 3 Posts
  • 0 Reply Likes
I observed that the contents are not displayed on the screen when I use the following command.
write-host $weather_info
However, when I redirect the result to a file like following,
$weather_info|fl >> $filename
I am able to see the contents records in the file as follows.
response            : @{version=0.1; termsofService=http://www.wunderground.com/weather/api/d/terms.html; features=;
                      error=}
location            : @{type=INTLCITY; country=IN; country_iso3166=IN; country_name=India; state=; city=Chennai; tz_short=IST; tz_long=Asia/Kolkata; lat=13.00000000; lon=80.18000031; zip=00000; magic=1; wmo=43279; l=/q/zmw:00000.1.43279; requesturl=global/stations/43279.html; 
                      wuiurl=https://www.wunderground.com/global/stations/43279.html; nearby_weather_stations=}
current_observation : @{image=; display_location=; observation_location=; estimated=; station_id=VOMM; ....
At present, the JSON content is returned as multiple lines. Is it possible to get the JSON content as 1 line per entry? For example, 1 line for response, 1 line for location and 1 line for current_observation.