Documentation

Getting started with Time Loops API

Welcome to Time Loops API, your one-stop destination for real-world data on Music Albums, Quotes, Software Tools and Skyscrapers. This API offers authentic and detailed information that you can use to power your music apps, quotes apps, architecture projects, and software tools directories.

What You Get

EndpointDescription
Music AlbumsDetailed information about music albums, including artist, genre, release date, and more.
QuotesA collection of insightful quotes from a variety of categories and authors.
SkyscrapersData about famous buildings, including architects, architectural styles, construction dates, and more.
Software ToolsInformation about software tools, including descriptions, usage, creators, and more.

Supported Operations

Time Loops API supports a full set of CRUD operations, allowing you to:

  • Create (POST): Simulate adding new records for music albums, quotes, buildings or software tools.
  • Read (GET): Retrieve detailed information on all available categories and individual items.
  • Update (PUT): Replace an entire existing record with a new one.
  • Update (PATCH): Modify specific fields of an existing record.
  • Delete (DELETE): Simulate the removal of existing records.
Note: The POST, PUT, PATCH and DELETE operations simulate real-world behavior but do not persist or modify data.

Shapes

These are the expected data shapes when fetching, using TypeScript as an example.

You can find all types here or copy them directly from the boxes below.

General types such as Month, CustomDate and NamedLink: Used in Album and Skyscraper types.

export type Month =
| 'January' | 'February' | 'March' | 'April' 
| 'May' | 'June' | 'July' | 'August'
| 'September' | 'October' | 'November' | 'December';
export type NamedLink = {
link: string;
name: string;
};
export type CustomDate = {
day: number;
month: Month;
year: number;
};

1. Albums

export type MusicAlbum = {
id: number;
title: string;
artist: string;
description: string;
releaseDate: CustomDate;
genre: string;
label: NamedLink[];
wiki: string;
};

2. Quotes

export type Quote = {
id: number;
quote: string;
author: string;
category: string;
};

3. Skyscrapers (all types)

type SkyscraperType =
| 'Commercial'
| 'Office'
| 'Retail'
| 'Residential'
| 'Hotel'
| 'Shopping Mall';
type Area = {
city: string;
country: string;
mapsLink: string;
street: string;
};
type GalleryItem = {
id: number;
source: string;
alt: string;
};
export type Skyscraper = {
architects: NamedLink[];
architectureStyle: NamedLink;
constructionEnded: CustomDate;
constructionStarted: CustomDate;
floorArea: number;
floorCount: number;
gallery: GalleryItem[];
height: number;
informationParagraphs: string[];
location: Area;
numberOfElevators: number;
openedDate: CustomDate;
photo: string;
slug: string;
subtitle: string;
title: string;
type: SkyscraperType[];
website: string;
wiki: string;
};

4. Software Tools (all types)

type Creator = {
name: string;
wiki: string;
};
type Category =
| 'programming-language' | 'runtime' 
| 'framework' | 'library' | 'query-language'
| 'relational-database-management-system';
export type SoftwareTool = {
id: number;
title: string;
description: string;
image: string;
usage: string;
category: Category;
creators: Creator[];
yearCreated: number;
wiki: string;
};

Example Usage

Here’s how you can start using Time Loops API in your project:

Note: The examples in the documentation are written in JavaScript / TypeScript using the fetch API, but you can achieve the same results using any programming language or HTTP client, such as Axios, which automatically parses JSON responses.

Read a list (GET request)

fetch('https://timeloopsapi.com/albums')
.then(response => response.json())
.then(data => console.log('Albums:', data))
.catch(error => console.error('Error:', error));
This will fetch the list of all albums.
Notice: No need to specify method: "GET", because fetch() defaults to a GET request if no method is provided.

Read a Single item (GET request)

fetch('https://timeloopsapi.com/albums/2')
.then(response => response.json())
.then(data => console.log('Album:', data))
.catch(error => console.error('Error:', error));
This will fetch the second item from the list of all albums.

Create a Single item (POST request)

To add a new music album, send a POST request to the albums endpoint.

const newAlbum: MusicAlbum = {
id: 1,
title: 'Experience',
artist: 'The Prodigy',
description: 'Experience is the debut studio album by the Prodigy.',
releaseDate: {
day: 28,
month: 'Sept',
year: 1992,
},
genre: 'Electronic',
label: [
{
name: 'XL Recordings',
link: 'https://en.wikipedia.org/wiki/XL_Recordings'
}
],
wiki: 'https://en.wikipedia.org/wiki/Experience_(The_Prodigy_album)',
};
fetch('https://timeloopsapi.com/albums', {
method: 'POST',
body: JSON.stringify(newAlbum)
})
.then(response => response.json())
.then(data => console.log('New album added:', data))
.catch(error => console.error('Error:', error));
Data Structure: Make sure your request body matches the expected data structure for each type. Refer to the examples above for the format.
Notice: The POST request includes id: 1, because TypeScript expects the id key. Server will generate a unique id for the new entry.
Notice: The compiler shouts because month is of type Month. In this example, it must be written 'September'.

Delete a Single item (DELETE request)

Deleting a single item is straightforward:

fetch('https://timeloopsapi.com/software-tools/7', {
method: 'DELETE'
})
.then(response => response.json())
.then(data => console.log('Software Tool deleted:', data))
.catch(error => console.error('Error:', error));
This returns: Software Tool deleted: { "message": "Software Tool with id 7 (JavaScript) has been deleted successfully" }
Reminder: The DELETE request does not actually remove the resource from the server. Instead, the API simulates the deletion, making it appear as if the item was removed.

Update a Single item (PUT request)

The PUT request will replace the entire resource with the new data. All fields must be provided, and missing fields will be overwritten.

const updatedQuote =  {
quote: "It is not that I'm so smart, it's just that I stay with problems longer",
author: "Albert Einstein",
category: "wisdom"
};
fetch('https://timeloopsapi.com/quotes/1', {
method: 'PUT',
body: JSON.stringify(updatedQuote)
})
.then(response => response.json())
.then(data => console.log('Updated Quote:', data))
.catch(error => console.error('Error:', error));
The code above will completely replace the first quote.
Notice: The updatedQuote object doesn't have the id key - it's not mandatory. This can't be of type Quote now.
Reminder: The PUT request does not actually update the resource on the server. Instead, the API simulates the update, making it appear as if the change was successful.

Update a Single item (PATCH request)

The PATCH request will only update the specified fields, leaving the other fields of the resource unchanged.

const patchedSkyscraper =  {
subtitle: "One WTC"
};
fetch('https://timeloopsapi.com/skyscrapers/4', {
method: 'PATCH',
body: JSON.stringify(patchedSkyscraper)
})
.then(response => response.json())
.then(data => console.log('Updated Skyscraper:', data))
.catch(error => console.error('Error:', error));
The code above will partially update the One World TradeCenter Skyscraper.
Notice: The patchedSkyscraper object includes only the key-value pair we want to update.
Reminder: The PATCH request won't actually modify the resource on the server. Instead, the API mimics the update, giving the impression that the change was applied.