Launch Library

Science

Launch Library API Docs

The Launch Library API provides access to information about rocket launches, launch pads, and spacecrafts. This API can be integrated with applications to provide real-time updates and notifications on upcoming launches.

API Examples in JavaScript

Below are some example API requests in JavaScript:

Get upcoming rocket launches

async function getUpcomingLaunches() {
  const apiUrl = 'https://launchlibrary.net/1.3/launch/upcoming';
  const response = await fetch(apiUrl);
  const data = await response.json();
  console.log(data);
}

This code will make a request to the https://launchlibrary.net/1.3/launch/upcoming endpoint and return data on upcoming rocket launches. You can use this data to display launch information in your application.

Get launch pads

async function getLaunchPads() {
  const apiUrl = 'https://launchlibrary.net/1.3/pad';
  const response = await fetch(apiUrl);
  const data = await response.json();
  console.log(data);
}

This code will make a request to the https://launchlibrary.net/1.3/pad endpoint and return data on all launch pads. This data can be used to display information on launch facilities and provide users with information on where rockets are launched from.

Get spacecrafts

async function getSpacecrafts() {
  const apiUrl = 'https://launchlibrary.net/1.3/spacecraft';
  const response = await fetch(apiUrl);
  const data = await response.json();
  console.log(data);
}

The https://launchlibrary.net/1.3/spacecraft endpoint provides data on spacecrafts. This information can be useful for displaying details on the space vehicles that are used in launches.

In conclusion, the Launch Library API is a powerful tool for accessing information on rocket launches, launch pads, and spacecrafts. These examples in JavaScript can help you get started and integrate the API into your applications. Visit the official API documentation for more details on available endpoints and parameters.

Related APIs in Science