Python for Finance: Analyze Big Financial Data
elle
(Elle)
#1
Web Services
The last topic in this chapter — and a very interesting and important one — is web
services. Web services provide a simple and efficient means to access server-based
functionality via web protocols. For example, one of the web services with the highest
traffic is the Google search functionality. We are used to visiting http://www.google.com
and typing some words of interest into the search/text input field provided on the website.
However, what happens after you press the Return key or push the Search button is that
the page translates all the information it has (from the search field and maybe your
personal preferences) into a more or less complex URL.
num=5&q=yves+python. When you click this link or copy it into your web browser,
Google Search returns those five search results (num=5) that the engine considers the best
matches given the words provided (q=Yves+Python). Your web browser then displays
something similar to Figure 14-11.
Using web services, any kind of data- and transaction-oriented financial service can be
provided via web technologies. For instance, Yahoo! Finance and Google Finance offer
historical stock price information via such a web service approach. More complex services
such as derivatives pricing and risk analytics are also available via such services (for
example, the web-based analytics solution DEXISION; cf. http://derivatives-
analytics.com). The following example illustrates the implementation of such a service in
the context of option pricing.