News and Weather API - api

Is their a way to implement either sky.com, bt.com or bbc.com's weather and/or news API into our website ?
If so can you please explain how to do this and its not going to be used to make money its purpose is to allow our visitors to see the latest weather and news updates
Our site can support basic html shtml htm etc and .jsp .php 5.3 and mysql
Thanks for any help/advice in advance
I have already tried various other apis like Yahoo! Weather but i cant get it to work because i need it to locate the user and display weather for their current location like the BBC, Sky and BT does

Metwit weather API,
You can implement them client-side: 200 request/day (ip based throttling) no authentication required. Worldwide coverage, JSON and REST compliant.
You can register for extra API calls for free and if you still need it to call them server side the basic plan is pretty cheap.
Full disclosure: I own this sweet piece of API.

Related

Is there a REST API documentation that only publishes the root URL?

I´m trying to design a REST API for my application and I read a lot about best practices and how REST is supposed to work. One of the most important topics about REST is, that the resources should be linked via references and the client should only know the root URL of the API.
But I cannot find any API documentation that really does this. Every REST API documentation I ever read on the web shows an exact description of the URLs of the possible endpoints.
Is there any API documentation out there that only shows the root URL and describes how to navigate through the resources?
One of the most important topics about REST is, that the resources should be linked via references and the client should only know the root URL of the API.
The root URL and the media types, yes. The client needs to know where to start, and also how to interpret the responses it gets.
Your primary example of a REST API would be the world wide web. You point your browser at www.google.com, and then you just follow links and submit forms until you get the result you want.
Another REST API that might be familiar is Atom Syndication / Atom Pub.
More academically, there is RESTBucks. That paper was somewhat popular, and you can find a number of sample implementations around.
Jon Moore (2011) presented a good demonstration of a hypermedia API.
Every REST API documentation I ever read on the web shows an exact description of the URLs of the possible endpoints.
Yes; bad examples are much more common than good examples.

How can I protect my API and know what is calling it?

I am building a Web application, and Web API. The Web application will do ajax call to the server and receive JSON results. The same will happen to the Web API.
I am planing to ask developers to use keys to access the Web API so that I can charge for their uses of it.
The problem is the Web API will be use by the Web application to get the content for the web pages. Is there a way to know if it is my Web application using the Web API or someone trying to highjack the API so that they don't have to pay for it?
I am using PHP on my server.
It's difficult to protect completely but there are techniques that help. ApiAxle (disclaimer: my company) gives you the option of using short lived keys. These will be impossible for a leecher to generate without knowing your secret key. Paired with rate limiting you're getting somewhat closer to where you want to be.
Not foolproof but a start.
When trying to secure something on the web, it might be useful to think about how you want to protect the information that you provide by the api before you try to find a technique for protecting the api.
An example:
Say that your api provides the current weather in London and your web application is an open web page that provides this information while also showing some web ads. You don't want someone else to use the api and show the Lonodn weather somewhere else without showing the web ad because that would ruin your sole income from this service.
You could limit access to the api by providing i.e. short time keys or another complicated protocol, but the problem here is that the information you provides, the London weather, is available to anyone on the web page anyway. If someone wants to "steal" your information and provide the London weather on a different web site they can just write a script that loads your web application, reads the information from the web page and display this in their own web application.
If a person is able to access the information, then he can also write a script that reads this information and display the information somewhere else.
Securing information is actually more about limiting who you want to give access and not so much about how they should get access. If you or your clients makes this information freely available on the net in one form or another, then you cannot (technically) prevent someone else from picking it up and redistribute it.

Can client side mess with my API?

I have a website that revolves around transactions between two users. Each user needs to agree to the same terms. If I want an API so other websites can implement this into their own website, then I want to make sure that the other websites cannot mess with the process by including more fields in between or things that are irrelevant to my application. Is this possible?
If I was to implement such a thing, I would allow other websites to use tokens/URLs/widgets that would link them to my website. So, for example, website X wants to use my service to agree user A and B on the same terms. Their page will have an embedded form/frame which would be generated from my website and user B will also receive an email with link to my website's page (or a page of website X with a form/frame generated from my server).
Consider how different sites use eBay to enable users to pay. You buy everything on the site but when you are paying, either you are taken to ebay page and come back after payment, or the website has a small form/frame that is directly linked to ebay.
But this is my solution, one way of doing it. Hope this helps.
It depends on how your API is implemented. It takes considerably more work, thought, and engineering to build an API that can literally take any kind of data or to build an API that can take additional, named, key/value pairs as fields.
If you have implemented your API in this manner, then it's quite possible that users of this API could use it to extend functionality or build something slightly different by passing in additional data.
However, if your API is built to where specific values must be passed and these fields are required, then it becomes much more difficult for your API to be used in a manner that differs from what you originally intended.
For example, Google has many different API's for different purposes, and each API has a very specific number of required parameters that a developer must use in order to make a successful HTTP request. While the goal of these API's are to allow developers to extend functionality, they do allow access to only very specific pieces of data.
Lastly, you can use authentication to prevent unauthorized access to your API. The specific implementation details depend largely on the platform you're working with as well as how the API will be used. For instance, if users must login to use services provided by your API, then a form of OAuth may suffice. However, if other servers will consume your API, then the authorization will have to take place in the HTTP headers.
For more information on API best practices, see 7 Rules of Thumb When You Build an API, and a slideshow from a Google Engineer titled How to Design a Good API and Why That Matters.

Build a search-based-app using an API from a major search engine: google, bing, yahoo - who offers search API?

I need to provide search functionality as the cornerstone of my app (basically I think I can make a better interface than whats is offered by Google, bing, yahoo - bold claim I know). Therefore I will not build an entire search engine from scratch, I will rather use an API provider by a major search engine and simply modify the interface that present the results to my visitors. I am a Google fanboi and I initially tried to use Google Search AJAX API. However, I was very disappointed since I can barely change anything at all.
Specifically;
I need an API that will let me pull programmatically the results from a major search engine and let me output them with the style and goodies that I want.
I am not looking to alter the order in which the search results are presented to the user by inserting crap in between the good results (this is against my philosophy). But I would like to wrap massive php/javascript around each search results so that I can completely control how each result is graphically rendered.
I heard of the BING API 2.0, would that be more flexible than Google AJAX API? Could anyone provide output if any of the current search providers are offering API for this purpose right now?
After careful investigation it appears to me that the Bing 2.0 API is the most flexible and robust search API currently on the market.
The Bing API does require you to put their ads next to the results. You can place your own ads with the Yahoo API. The Yahoo API uses the same search technology (same results) and can be used starting from $0,40 per 1000 queries. The lowest, bulk price of the Google API is $4,00 per 1000 queries. Google's relevance is easily ten times higher for the somewhat more advanced queries.
And also Bing version 2 search API is free!
Whereas, Yahoo BOSS V2 has pricing and so Google does custom search API.

Are there any websites providing free news, weather, photos APIs for using this data commercially

I want to build a service which needs to get this data from some source for further analysis. Does Google, Yahoo or someone else provides free access to this data for use in other websites using some API. I think Twitter does something like this for their data although they enforce some limits on this. The data I need is mostly for US and Canada.
Thanks,
Gary
You can find a bunch of free web services here: http://www.webservicex.net/
If you can stand the ads, you can also check here: http://www.webservicelist.com/