Weather API Help-VBForums
Results 1 to 8 of 8

Thread: Weather API Help

  1. #1

    Thread Starter
    Member jbailey01's Avatar
    Join Date
    Jul 2012
    Posts
    45

    Question 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 04:59 PM.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    87,257

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member jbailey01's Avatar
    Join Date
    Jul 2012
    Posts
    45

    Re: Weather API Help

    Could you recommend a good example of how to use one?

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    87,257

    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.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member jbailey01's Avatar
    Join Date
    Jul 2012
    Posts
    45

    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

  6. #6

    Thread Starter
    Member jbailey01's Avatar
    Join Date
    Jul 2012
    Posts
    45

    Re: Weather API Help

    Any advice?

  7. #7
    Addicted Member scottlafoy's Avatar
    Join Date
    Feb 2009
    Location
    Calgary Alberta, Canada
    Posts
    148

    Re: Weather API Help

    Quote Originally Posted by jbailey01 View Post
    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

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,012

    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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.