-
Weather API Help
Hello all,
I'm a fairly newer programmer. And I don't quite understand how API's work exactly and I can't find any easy to understand tutorials(I've been looking alot today). I am hoping to use a weather API (http://www.wunderground.com/weather/api/) in a program I am working on and I was hoping someone would be kind enough to point me in the right direction to figure this thing out. Thanks :)
-
Re: Weather API Help
An API is simply a set of public methods that you can call. They will give you access to a web service, you add a web reference to your project and away you go. You use the types and members exposed by that service just like you would any other types and members.
-
Re: Weather API Help
Could you recommend a good example of how to use one?
-
Re: Weather API Help
You're trying to make this difficult when it's not. An API is simply a set of methods. They are just like any other methods. You call them like you call any other methods. You don;t need any special knowledge or skills. If you've called any methods before then you can call the methods exposed by that API. You've already written code in VB.NET so you have already used the .NET API. All the types and methods exposed by the .NET Framework are the API.
-
Re: Weather API Help
Okay so when I pull the data I have it going to a richtextbox and the contents are
{
"response": {
"version": "0.1",
"termsofService": "http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"conditions": 1
}
},
"current_observation": {
"image": {
"url": "http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png",
"title": "Weather Underground",
"link": "http://www.wunderground.com"
},
"display_location": {
"full": "San Francisco, CA",
"city": "San Francisco",
How exactly would I have for example Label1.text equal the value of "full": ...? Meaning that Label1.text = "San Francisco"?
Sorry, im really lost on this whole thing :confused:
-
Re: Weather API Help
-
Re: Weather API Help
Quote:
Originally Posted by
jbailey01
Any advice?
Sorry that I'm late to the party. It looks to me like the method you are calling is returning JSON. It looks like a string but if you look up JSON converters for .net you will find how to parse the data you need from it. A lot of web services will return JSON because most languages have something to parse it into
what you want.
-
Re: Weather API Help
I think it really stretches a point to think something like a ".Net API" and even less some set of HTTP operations has anything at all to do with the APIs this forum is here for.
This forum is specifically for the Win32 API.
If you take any broader interpretation of "API" you could post here on just about 90% of the code anyone ever writes.
What you have there is a Web Service of a specific kind.