> For the complete documentation index, see [llms.txt](https://docs.debate.land/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.debate.land/examples.md).

# Examples

## Getting Leaders

{% embed url="<https://codepen.io/therealbaljeet/pen/LYOOZLp>" %}
Getting the leaderboard for the 2020-21 PF National Circuit
{% endembed %}

Here's the Javascript we used.

```javascript
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);
  })
});
```

First, we set up our constants - format, circuit, and year. If you need help with these, see [API Constants and Schemas](/api-constants-and-schemas.md).

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

{% embed url="<https://codepen.io/therealbaljeet/pen/bGYYeYv>" %}
Getting Bethesda Chevy Chase GT's Information for the 2020-21 PF National Circuit
{% endembed %}

Here's the Javascript we used.

```javascript
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);
  })
});
```

First, we set up our constants - format, circuit, and year. If you need help with these, see [API Constants and Schemas](/api-constants-and-schemas.md). This time, I added in the team ID for Bethesda Chevy Chase GT, since we're querying for their data specifically.

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

{% embed url="<https://codepen.io/therealbaljeet/pen/YzEEWaN>" %}
Querying for all records from "Strake" for the 2020-21 PF National CIrcuit
{% endembed %}

Here's the Javascript we used.

```javascript
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);
  })
});
```

First, we set up our constants - format, circuit, and year. If you need help with these, see [API Constants and Schemas](/api-constants-and-schemas.md). This time, I added in the term "Strake", since we're querying for their data specifically.

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.debate.land/examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
