Skip to main content

REST-based Web Services

  • Chapter
  • First Online:
XML and Web Technologies for Data Sciences with R

Part of the book series: Use R! ((USE R))


Web services are an important development in making data available to clients in a programmatic manner. Rather than displaying results for humans to view on the Web, we can make requests to a Web service in order to get the resulting data directly and then consume it in our applications immediately. An increasingly common architecture for Web services is termed REST and exploits the concept of URLs as resources. We can make general HTTP requests to retrieve, update, modify, and even create resources. The results (and sometimes the inputs) are often formatted as JSON or XML. In this chapter, we look at how we can access REST services from within R, mapping the documentation for the services into requests, converting the results, and developing R functions to provide higher-level interfaces that hide the details of the HTTP and conversion. REST is becoming the dominant mechanism used for Web services which are also becoming very common. REST is not just used for Web services, but is also increasingly used to communicate with regular applications such as NoSQLdatabases and text search engines and we explore these also in this chapter.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others


  1. Daniel Adler. rdyncall: Improved foreign function interface (FFI) and dynamic bindings to C libraries (e.g., OpenGL). , 2012. R package version 0.7.5.

  2. J. Anderson, Jan Lehnardt, and Noah Slater. CouchDB: The Definitive Guide. O’Reilly Media, Inc., Sebastopol, CA, 2010.

    Google Scholar 

  3. Thomas Bock. R4CouchDB: Collection of R functions for CouchDB access. , 2011. R package version 0.08.

  4. Jeroen Ooms. opencpu.encode: Encodes R objects to a standardized JSON format. , 2012. R package version 0.22.

  5. R Core Team. Condition Handling and Recovery, 2012. .

  6. Leonard Richardson and Sam Ruby. RESTful Web Services. O’Reilly Media, Inc., Sebastopol, CA, 2007.

    Google Scholar 

  7. Wendell Santos. 195 science APIs: Springer, EPA, and NCBI. , 2012.

  8. Duncan Temple Lang. RGCCTranslationUnit: R interface to GCC source code information. , 2009. R package version 0.4-0.

  9. Duncan Temple Lang. RAmazonDBREST: REST-based interface to Amazon’s SimpleDB. , 2011. R package version 0.1-1.

  10. Duncan Temple Lang. Rffi: Interface to libffi to dynamically invoke arbitrary compiled routines at run-time without compiled bindings. , 2011. R package version 0.3-0.

  11. Duncan Temple Lang. RJSONIO: Serialize R objects to JSON (JavaScript Object Notation). , 2011. R package version 0.95.

  12. Duncan Temple Lang. WADL: Programmatically process Web Application Description Language documents. , 2011. R package version 0.2-0.

  13. Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS. , 2011. R package version 3.4.

  14. Duncan Temple Lang. Zillow: Simple interface to’s house price estimate API. , 2011. R package version 0.1-1.

  15. Duncan Temple Lang. RCurl: General network (HTTP, FTP, etc.) client interface for R. , 2012. R package version 1.95-3.

  16. Duncan Temple Lang. RGoogleDocs: Primitive interface to Google Documents from R. , 2012. R package version 0.7-0.

  17. Duncan Temple Lang. SSOAP: Client-side SOAP access for R. , 2012. R package version 0.9-0.

  18. Duncan Temple Lang. XMLSchema: R facilities to read XML schema. , 2012. R package version 0.7-0.

  19. Duncan Temple Lang and Roger Peng. RAmazonS3: R interface to Amazon’s S3 storage. , 2011. R package version 0.1-5.

  20. Eric van der Vlist. XML Schema. O’Reilly Media, Inc., Sebastopol, CA, 2002.

    Google Scholar 

  21. Zillow, Inc. Zillow: A free online real estate marketplace. , 2012.

Download references

Author information

Authors and Affiliations


Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer Science+Business Media New York

About this chapter

Cite this chapter

Nolan, D., Lang, D.T. (2014). REST-based Web Services. In: XML and Web Technologies for Data Sciences with R. Use R!. Springer, New York, NY.

Download citation

Publish with us

Policies and ethics