Tabroom REST API
  • Tabroom REST API
  • Documentation
  • API Constants & Schemas
  • Examples
  • Schemas
Powered by GitBook
On this page
  • Getting Leaders
  • Getting A Specific Team
  • Searching For A School

Examples

Basic Examples to help you familiarize yourself with the API.

PreviousAPI Constants & SchemasNextSchemas

Last updated 3 years ago

Getting Leaders

Here's the Javascript we used.

const format = "PF";
const circuit = "National";
const year = "SY_20_21";

const content = document.getElementById("content");

fetch(`https://tournaments.tech/leaders?format=${format}&circuit=${circuit}&year=${year}`).then(response => {
  response.json().then(data => {
    content.innerText = JSON.stringify(data);
  })
});

Next, we grab a reference to a blank div in the DOM so that we can insert our response later.

We use the fetch api to ping the /leaders endpoint with a GET request, and then provide our constants in the query.

After getting the response json, we put it in the div we grabbed earlier.

Getting A Specific Team

Here's the Javascript we used.

const format = "PF";
const circuit = "National";
const year = "SY_20_21";
const team = "6204506bd1a7e6db5199f014";

const content = document.getElementById("content");

fetch(`https://tournaments.tech/query?format=${format}&circuit=${circuit}&year=${year}&team=${team}`).then(response => {
  response.json().then(data => {
    content.innerText = JSON.stringify(data);
  })
});

Next, we grab a reference to a blank div in the DOM so that we can insert our response later.

We use the fetch api to ping the /query endpoint with a GET request, and then provide our constants in the query.

After getting the response json, we put it in the div we grabbed earlier.

Searching For A School

Here's the Javascript we used.

const format = "PF";
const circuit = "National";
const year = "SY_20_21";
const term = "Strake";

const content = document.getElementById("content");

fetch(`https://tournaments.tech/query?format=${format}&circuit=${circuit}&year=${year}&term=${term}`).then(response => {
  response.json().then(data => {
    content.innerText = JSON.stringify(data);
  })
});

Next, we grab a reference to a blank div in the DOM so that we can insert our response later.

We use the fetch api to ping the /query endpoint with a GET request, and then provide our constants in the query.

After getting the response json, we put it in the div we grabbed earlier.

First, we set up our constants - format, circuit, and year. If you need help with these, see .

First, we set up our constants - format, circuit, and year. If you need help with these, see . This time, I added in the team ID for Bethesda Chevy Chase GT, since we're querying for their data specifically.

First, we set up our constants - format, circuit, and year. If you need help with these, see . This time, I added in the term "Strake", since we're querying for their data specifically.

API Constants and Schemas
API Constants and Schemas
API Constants and Schemas
Getting the leaderboard for the 2020-21 PF National Circuit
Getting Bethesda Chevy Chase GT's Information for the 2020-21 PF National Circuit
Querying for all records from "Strake" for the 2020-21 PF National CIrcuit