Tools that Support My Online Articles

How to Execute a REST API Call on Apache Spark the Right Way

This simple REST based web service is designed for use with the example code in the article on medium.com. The data is sourced from the US Government at https://vpic.nhtsa.dot.gov/api/vehicles/getallmakes?format=json

The web service can be accessed via the following URL:

https://tools.rulenumberfour. co.uk/api/vehicles/[page]

E.g. https://tools.rulenumberfour. co.uk/api/vehicles/1

The web service accepts a single parameter via the URL itself and that is the page number itself. It will return a maximum of 100 records per page along-with a HTTP Status Code of 200 on success.

On error, (i.e. invalid page number) a status code of 405 will be returned.

Schema

  • page is the requested page number
  • maxRecords is the total number of results in the dataset. I.e. maxResults/100 = total pages

Example REST API Response

James Hocking

James Hocking

Hello there,

I am James, and thank you for connecting with me. I have been in the software development industry for some time now, 25 years, and I have a real passion for data and analytics. I love discovering why people do what they do and helping others overcome the challenges they face. I love to show people how data can help them to understand their customers, why they do what they do, and grow themselves.

I started programming when I was just six years old and have been hooked ever since. I studied computing at university, where I discovered the mystery and wonders of data. I have worked in e-commerce, marketing, and sales ever since. I now specialize in coaching others and providing them with the confidence and tools they need to succeed.

This site offers tools and demonstrations that support the articles that I write. Check me out on Medium, or Linkedin.