Getting Started with Enigma Public API

Enigma Public provides a suite of Data API's allowing developers to access highly curated data sets via RESTful endpoints. The API's are designed to be both flexible and easy to use, returning responses in JSON format with standard HTTP response codes.

To get started with Enigma Public API, you will need an API key, which can be obtained by signing up for a free account on the Enigma Public website.

Authentication

All Enigma Public API requests require authentication via an API key as a query parameter or an HTTP header. In this example, we will pass the API key as a query parameter.

const API_KEY = 'YOUR_API_KEY';

fetch(`https://public.enigma.com/api/v2/entities?name=biontech&access_token=${API_KEY}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Sample API Requests

Search for entities by name

fetch(`https://public.enigma.com/api/v2/entities?name=biontech&access_token=${API_KEY}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Get an entity by ID

const ENTITY_ID = 'f2ae2dd7-f9dd-4cf5-a9a5-be88d6f22e22';

fetch(`https://public.enigma.com/api/v2/entities/${ENTITY_ID}?access_token=${API_KEY}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Search for data sets by tags

fetch(`https://public.enigma.com/api/v2/datasets?tags=covid&access_token=${API_KEY}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Get a data set by ID

const DATASET_ID = 'c4ae4df1-1e60-4fbc-9101-e8658e9764cf';

fetch(`https://public.enigma.com/api/v2/datasets/${DATASET_ID}?access_token=${API_KEY}`)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Conclusion

Enigma Public API provides developers with access to a wealth of high-quality data sets, enabling them to build powerful applications, conduct research, and perform data analysis. With this quick guide, you should now be able to authenticate and make requests to the Enigma Public API using JavaScript. Happy coding!

Related APIs

Public APIs — A directory of free and public apis

Built by @mddanishyusuf