-
Jan 3rd, 2013, 05:38 PM
#1
Thread Starter
Member
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
Last edited by jbailey01; Jan 3rd, 2013 at 05:59 PM.
-
Jan 3rd, 2013, 06:50 PM
#2
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.
-
Jan 3rd, 2013, 06:56 PM
#3
Thread Starter
Member
Re: Weather API Help
Could you recommend a good example of how to use one?
-
Jan 3rd, 2013, 07:24 PM
#4
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.
-
Jan 3rd, 2013, 10:49 PM
#5
Thread Starter
Member
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
-
Jan 4th, 2013, 08:41 AM
#6
Thread Starter
Member
-
Mar 18th, 2013, 01:30 PM
#7
Addicted Member
Re: Weather API Help
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.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-
Mar 19th, 2013, 05:21 AM
#8
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|