July 2018
Intermediate to advanced
324 pages
8h 14m
English
Mashape is the largest API marketplace for private and public APIs. There are thousands of API providers and consumers registered. Have a look at the marketplace at https://market.mashape.com. We are going to use the Random Famous Quote API (https://market.mashape.com/andruxnet/random-famous-quotes). Once you are logged in to the Mashape marketplace, you can explore these APIs in detail. The following code snippet has one of the APIs that we are using to fetch a random quote.
The following is the code snippet of the mashape.py file.
File—mashape.py:
import osimport requestsdef fetch_quote(): response = requests.get( os.environ.get('Mashape_API_Endpoint'), headers={ 'X-Mashape-Key': os.environ.get('X_Mashape_Key'), ...Read now
Unlock full access