List Theatres
curl --request GET \
--url https://api.example.com/theatresimport requests
url = "https://api.example.com/theatres"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/theatres', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/theatres",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/theatres"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/theatres")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/theatres")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"theatres": [
{
"id": "<string>",
"name": "<string>",
"address": "<string>",
"postcode": "<string>",
"lat": 123,
"lng": 123,
"capacity": 123,
"current_show_id": "<string>"
}
]
}Theatres
List Theatres
Retrieve all West End theatre venues
GET
/
theatres
List Theatres
curl --request GET \
--url https://api.example.com/theatresimport requests
url = "https://api.example.com/theatres"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/theatres', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/theatres",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/theatres"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/theatres")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/theatres")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"theatres": [
{
"id": "<string>",
"name": "<string>",
"address": "<string>",
"postcode": "<string>",
"lat": 123,
"lng": 123,
"capacity": 123,
"current_show_id": "<string>"
}
]
}Overview
Returns a list of all theatre venues in the database. Currently includes 32+ West End theatres in London with their locations, capacity, and current show information.Request
curl https://entertheatre.com/api/theatres
const response = await fetch('https://entertheatre.com/api/theatres');
const theatres = await response.json();
import requests
response = requests.get('https://entertheatre.com/api/theatres')
theatres = response.json()
Response
array
Array of theatre objects
Show Theatre Object
Show Theatre Object
Example Response
[
{
"id": "theatre-001",
"name": "Her Majesty's Theatre",
"address": "Haymarket",
"postcode": "SW1Y 4QL",
"lat": 51.5094,
"lng": -0.1313,
"capacity": 1216,
"current_show_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"id": "theatre-002",
"name": "Victoria Palace Theatre",
"address": "Victoria Street",
"postcode": "SW1E 5EA",
"lat": 51.4965,
"lng": -0.1437,
"capacity": 1550,
"current_show_id": "550e8400-e29b-41d4-a716-446655440001"
},
{
"id": "theatre-003",
"name": "St Martin's Theatre",
"address": "West Street",
"postcode": "WC2H 9NZ",
"lat": 51.5126,
"lng": -0.1275,
"capacity": 550,
"current_show_id": "550e8400-e29b-41d4-a716-446655440002"
}
]
Status Codes
| Status | Description |
|---|---|
200 | Success - returns array of theatres |
500 | Server error |