Accessing web APIs

Rich interfaces can be created through the web, allowing powerful interactions through HTTP. The most common interface is through RESTful APIs using JSON. These text-based interfaces are easy to understand and to program, and use common technologies that are language agnostic, meaning they can be accessed in any programming language that has an HTTP client module, including, of course, Python.

Formats other than JSON are used, such as XML, but JSON is a very simple and readable format that translates very well into Python dictionaries (and other language equivalents). JSON is, by far, the most common format in RESTful APIs at the moment. Learn more about JSON here:  https://www.json.org/.

The strict definition of RESTful requires some characteristics, but a more informal definition could be accessing resources through URLs. This means a URL represents a particular resource, such as an article in a newspaper or a property on a real estate site. Resources can then be manipulated through HTTP methods (GET to view, POST to create, PUT/PATCH to edit, and DELETE to delete) to manipulate them.

Proper RESTful interfaces need to have certain characteristics, and are a way of creating interfaces that is not strictly restricted to HTTP interfaces. You can read more about it here:  https://codewords.recurse.com/issues/five/what-restful-actually-means.

Using requests is very easy with them, as it includes native JSON support.