The Whale Hotline

Animals

The Whale Museum Public API Docs

The public API of The Whale Museum provides access to the museum's collection of marine life data. The API allows you to retrieve information on various species of whales, porpoises, dolphins and more. This API is open to the public and can be accessed using HTTP requests. You can view the documentation for the API at the official website.

API Endpoints

The API provides several endpoints, each specializing in different types of data:

  • /species -> to get a list of all species in the museum’s database
  • /species/{species} -> to get information about a specific species
  • /sightings -> to get a list of all sightings.
  • /sightings?species=orca -> to get all sightings of a specific species
  • /sightings/{id} -> to get a specific sighting

Authentication

The API requires no authentication or API key. You are free to use it without any limitations.

Examples

Here are some example codes in JavaScript on how to use the Whale Museum Public API.

Get all whale species

fetch('http://hotline.whalemuseum.org/api/species')
  .then((response) => response.json())
  .then((data) => console.log(data));

Get information about a specific whale species

fetch('http://hotline.whalemuseum.org/api/species/gray-whale')
  .then((response) => response.json())
  .then((data) => console.log(data));

Get all sightings

fetch('http://hotline.whalemuseum.org/api/sightings')
  .then((response) => response.json())
  .then((data) => console.log(data));

Get all sightings of a specific species

fetch('http://hotline.whalemuseum.org/api/sightings?species=orca')
  .then((response) => response.json())
  .then((data) => console.log(data));

Get a specific sighting

fetch('http://hotline.whalemuseum.org/api/sightings/85')
  .then((response) => response.json())
  .then((data) => console.log(data));

Conclusion

The Whale Museum Public API is a great resource for developers who are interested in marine life data. With its simple and intuitive endpoints, you can easily retrieve information about whales, porpoises, dolphins and other marine life. The API is open to the public and requires no authentication API key. Give it a try today!

Related APIs in Animals