Javascript to consume APIs

All APIs listed on Mashape can be consumed directly from your browser. Discover how you can do this with our example listed below.

Table of Contents

  1. Use JavaScript

Using JavaScript to consume APIs

When consuming an API through Mashape, you can run directly in your website or browser console by using this sample code snippet below which is CORS-enabled and uses jQuery: This way you don’t even have to worry about cross-domain requests.

Within an HTML page you can use it this way: