NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

I have:

using Nancy;
using Nancy.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using TARpe22ShopRohusaar.ApplicationServices.Services;
using TARpe22ShopRohusaar.Core.Dto.WeatherDtos;

namespace TARpe22ShopRohusaar.ApplicationServices.Services
{
public class WeatherForecastsServicesOW : IWeatherForecastsServices
{
public Task<WeatherResultDto> WeatherDetail(WeatherResultDto dto)
{
throw new NotImplementedException();
}

public async Task<WeatherResultDtoOW> WeatherDetailOW(WeatherResultDtoOW dto)
{
//City Name = "Tallinn, EE" Location = "EUR|EE|EN001|TALLINN" Country = "Estonia"

string appid = "9f5e058e16777cbc9cdb78ae841aff58";
var url = $"http://api.openweathermap.org/geo/1.0/direct?q=Tallinn&limit=5&appid=9f5e058e16777cbc9cdb78ae841aff58";

using (WebClient client = new WebClient())
{
string json = client.DownloadString(url);

WeatherRootDto weatherInfoOW = new JavaScriptSerializer().Deserialize<WeatherRootDto>(json);

dto.Lon = weatherInfoOW.CoordOW.Lon;
dto.Lat = weatherInfoOW.CoordOW.Lat;
dto.Temp = weatherInfoOW.MainOW.Temp;
dto.FeelsLike = weatherInfoOW.MainOW.FeelsLike;
dto.TempMin = weatherInfoOW.MainOW.TempMin;
dto.TempMax = weatherInfoOW.MainOW.TempMax;
dto.Pressure = weatherInfoOW.MainOW.Pressure;
dto.Humidity = weatherInfoOW.MainOW.Humidity;

dto.SeaLevel = weatherInfoOW.MainOW.SeaLevel;
dto.GrndLevel = weatherInfoOW.MainOW.GrndLevel;
dto._1h = weatherInfoOW.RainOW._1h;

dto.Main = weatherInfoOW.WeatherOW.Main;
dto.Description = weatherInfoOW.WeatherOW.Description;
dto.Visibility = weatherInfoOW.RootOW.Visibility;
dto.Name = weatherInfoOW.RootOW.Name;

dto.Country = weatherInfoOW.SysOW.Country;

}

return dto;
}
}
}


But I need to get required parameters lat and lon through Geocoding API. Help me. Api call: http://api.openweathermap.org/geo/1.0/direct?q={city name},{state code},{country code}&limit={limit}&appid={API key}
Parameters: q (City name, state code (only for the US) and country code divided by comma. Please use ISO 3166 country codes.); appid (Your unique API key (you can always find it on your account page under the "API key" tab));
example of api call: http://api.openweathermap.org/geo/1.0/direct?q=London&limit=5&appid={API key}
Example for api response:

[
{
"name":"London",
"local_names":{
"ms":"London",
"gu":"લંડન",
"is":"London",
"wa":"Londe",
"mg":"Lôndôna",
"gl":"Londres",
"om":"Landan",
"ku":"London",
"tw":"London",
"mk":"Лондон",
"ee":"London",
"fj":"Lodoni",
"gd":"Lunnainn",
"ky":"Лондон",
"yo":"Lọndọnu",
"zu":"ILondon",
"bg":"Лондон",
"tk":"London",
"co":"Londra",
"sh":"London",
"de":"London",
"kl":"London",
"bi":"London",
"km":"ឡុងដ៍",
"lt":"Londonas",
"fi":"Lontoo",
"fy":"Londen",
"ba":"Лондон",
"sc":"Londra",
"feature_name":"London",
"ja":"ロンドン",
"am":"ለንደን",
"sk":"Londýn",
"mr":"लंडन",
"es":"Londres",
"sq":"Londra",
"te":"లండన్",
"br":"Londrez",
"uz":"London",
"da":"London",
"sw":"London",
"fa":"لندن",
"sr":"Лондон",
"cu":"Лондонъ",
"ln":"Lóndɛlɛ",
"na":"London",
"wo":"Londar",
"ig":"London",
"to":"Lonitoni",
"ta":"இலண்டன்",
"mt":"Londra",
"ar":"لندن",
"su":"London",
"ab":"Лондон",
"ps":"لندن",
"bm":"London",
"mi":"Rānana",
"kn":"ಲಂಡನ್",
"kv":"Лондон",
"os":"Лондон",
"bn":"লন্ডন",
"li":"Londe",
"vi":"Luân Đôn",
"zh":"伦敦",
"eo":"Londono",
"ha":"Landan",
"tt":"Лондон",
"lb":"London",
"ce":"Лондон",
"hu":"London",
"it":"Londra",
"tl":"Londres",
"pl":"Londyn",
"sm":"Lonetona",
"en":"London",
"vo":"London",
"el":"Λονδίνο",
"sn":"London",
"fr":"Londres",
"cs":"Londýn",
"io":"London",
"hi":"लंदन",
"et":"London",
"pa":"ਲੰਡਨ",
"av":"Лондон",
"ko":"런던",
"bh":"लंदन",
"yi":"לאנדאן",
"sa":"लन्डन्",
"sl":"London",
"hr":"London",
"si":"ලන්ඩන්",
"so":"London",
"gn":"Lóndyre",
"ay":"London",
"se":"London",
"sd":"لنڊن",
"af":"Londen",
"ga":"Londain",
"or":"ଲଣ୍ଡନ",
"ia":"London",
"ie":"London",
"ug":"لوندۇن",
"nl":"Londen",
"gv":"Lunnin",
"qu":"London",
"be":"Лондан",
"an":"Londres",
"fo":"London",
"hy":"Լոնդոն",
"nv":"Tooh Dineʼé Bikin Haalʼá",
"bo":"ལོན་ཊོན།",
"ascii":"London",
"id":"London",
"lv":"Londona",
"ca":"Londres",
"no":"London",
"nn":"London",
"ml":"ലണ്ടൻ",
"my":"လန်ဒန်မြို့",
"ne":"लन्डन",
"he":"לונדון",
"cy":"Llundain",
"lo":"ລອນດອນ",
"jv":"London",
"sv":"London",
"mn":"Лондон",
"tg":"Лондон",
"kw":"Loundres",
"cv":"Лондон",
"az":"London",
"oc":"Londres",
"th":"ลอนดอน",
"ru":"Лондон",
"ny":"London",
"bs":"London",
"st":"London",
"ro":"Londra",
"rm":"Londra",
"ff":"London",
"kk":"Лондон",
"uk":"Лондон",
"pt":"Londres",
"tr":"Londra",
"eu":"Londres",
"ht":"Lonn",
"ka":"ლონდონი",
"ur":"علاقہ لندن"
},
"lat":51.5073219,
"lon":-0.1276474,
"country":"GB",
"state":"England"
},
{
"name":"City of London",
"local_names":{
"es":"City de Londres",
"ru":"Сити",
"ur":"لندن شہر",
"zh":"倫敦市",
"en":"City of London",
"pt":"Cidade de Londres",
"fr":"Cité de Londres",
"uk":"Лондонське Сіті",
"he":"הסיטי של לונדון",
"hi":"सिटी ऑफ़ लंदन",
"ko":"시티 오브 런던",
"lt":"Londono Sitis"
},
"lat":51.5156177,
"lon":-0.0919983,
"country":"GB",
"state":"England"
},
{
"name":"London",
"local_names":{
"el":"Λόντον",
"fr":"London",
"oj":"Baketigweyaang",
"en":"London",
"bn":"লন্ডন",
"be":"Лондан",
"ko":"런던",
"he":"לונדון",
"ru":"Лондон",
"lt":"Londonas",
"hy":"Լոնտոն",
"ga":"Londain",
"ja":"ロンドン",
"yi":"לאנדאן",
"cr":"ᓬᐊᐣᑕᐣ",
"iu":"ᓚᓐᑕᓐ",
"ar":"لندن",
"lv":"Landona",
"fa":"لندن",
"ug":"لوندۇن",
"th":"ลอนดอน",
"ka":"ლონდონი"
},
"lat":42.9832406,
"lon":-81.243372,
"country":"CA",
"state":"Ontario"
},
{
"name":"Chelsea",
"local_names":{
"id":"Chelsea, London",
"uk":"Челсі",
"hi":"चेल्सी, लंदन",
"ga":"Chelsea",
"es":"Chelsea",
"de":"Chelsea",
"af":"Chelsea, Londen",
"vi":"Chelsea, Luân Đôn",
"pl":"Chelsea",
"pt":"Chelsea",
"da":"Chelsea",
"ko":"첼시",
"sv":"Chelsea, London",
"nl":"Chelsea",
"az":"Çelsi",
"it":"Chelsea",
"hu":"Chelsea",
"no":"Chelsea",
"fr":"Chelsea",
"he":"צ'לסי",
"eu":"Chelsea",
"ru":"Челси",
"ar":"تشيلسي",
"en":"Chelsea",
"el":"Τσέλσι",
"tr":"Chelsea, Londra",
"zh":"車路士",
"sh":"Chelsea, London",
"ja":"チェルシー",
"ur":"چیلسی، لندن",
"sk":"Chelsea",
"fa":"چلسی",
"et":"Chelsea"
},
"lat":51.4875167,
"lon":-0.1687007,
"country":"GB",
"state":"England"
},
{
"name":"London",
"lat":37.1289771,
"lon":-84.0832646,
"country":"US",
"state":"Kentucky"
}
]
Do it with Tallinn
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.