# API Documentation

# API Documentation: Get Level Information

## Endpoint

**URL**:

```
https://db.lilacdancecenter.com/api/get_level

```

**Method**:  
`GET`

---

## Query Parameters

<table id="bkmrk-parameter-type-descr"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`first_name`</td><td>String</td><td>The dancer's first name. Required.</td></tr><tr><td>`last_name`</td><td>String</td><td>The dancer's last name. Required.</td></tr></tbody></table>

Example Request:

```
https://db.lilacdancecenter.com/api/getlevel?first_name=John&last_name=Doe

```

---

## Response

The endpoint returns a JSON object containing the dancer's levels for each dance style and their first competition date.

### JSON Response Format

```json
{
  "smooth_level": "bronze",
  "standard_level": "silver",
  "rhythm_level": "silver",
  "latin_level": "bronze",
  "start_date": "2022-03-12T00:00:00.000-05:00",
  "level_dates" {
    "smooth": {
      "newcomer": {
        "date": "2022-03-12T00:00:00.000-05:00",
        "event_id": 72276,
        },
      "bronze": { ... },
      ...
    },
    "standard": { ... },
    ...
  } 
}

```

### Response Parameters

<table id="bkmrk-field-type-descripti"><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`smooth_level`</td><td>String</td><td>The level of the dancer in Smooth style (e.g., bronze, silver, etc.).</td></tr><tr><td>`standard_level`</td><td>String</td><td>The level of the dancer in Standard style (e.g., bronze, silver, etc.).</td></tr><tr><td>`rhythm_level`</td><td>String</td><td>The level of the dancer in Rhythm style (e.g., bronze, silver, etc.).</td></tr><tr><td>`latin_level`</td><td>String</td><td>The level of the dancer in Latin style (e.g., bronze, silver, etc.).</td></tr><tr><td>`start_date`</td><td>Date String</td><td>The UTC timestamp of the dancer's first competition in the format `YYYY-MM-DDTHH:MM:SS.MS-05:00`.   
Ex: `2022-03-12T00:00:00.000-05:00`</td></tr><tr><td>`level_dates`</td><td>Nested Dictionary</td><td>Contains the dates at which this individual reached a level, per style. Also includes the LilacDB event id that caused the level increase for those curious.   
Event id use: `https://db.lilacdancecenter.com/events?event_id=xxxxx`</td></tr></tbody></table>

---

## Behavior

- The API retrieves the levels associated with the provided dancer's first and last name.
- The `start_date` field corresponds to the date and time of the dancer's **first competition**.

---

## Example Usage

**Request**:

```
GET https://db.lilacdancecenter.com/api/get_level?first_name=Jane&last_name=Doe

```

**Response**:

```json
{
  "smooth_level": "silver",
  "standard_level": "gold",
  "rhythm_level": "bronze",
  "latin_level": "silver",
  "start_date": "2023-06-15T00:00:00.000-05:00",
  "level_dates": { ... }
}

```

This response indicates that:

- The dancer "Jane Doe" has the following dance levels: 
    - Smooth: Silver
    - Standard: Gold
    - Rhythm: Bronze
    - Latin: Silver
- Their first competition took place on **June 15, 2023**.

---

## Notes

- Levels are categorized into predefined tiers such as **bronze**, **silver**, or **gold**, as detailed in the MIT Ballroom Dance Team's [About YCN Points](http://ballroom.mit.edu/index.php/ycn-proficiency-points/)

# API Documentation: Get Preferred Name, Pronouns, Pronunciation

## Endpoint

**URL**:

```
db.lilacdancecenter.com/api/get_preferred_name

```

**Method**:  
`GET`

---

## Query Parameters

<table id="bkmrk-parameter-type-descr"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`first_name`</td><td>String</td><td>The dancer's first name. Required.</td></tr><tr><td>`last_name`</td><td>String</td><td>The dancer's last name. Required.</td></tr></tbody></table>

Example Request:

```
https://db.lilacdancecenter.com/api/get_preferred_name?first_name=John&last_name=Doe

```

---

## Response

The endpoint returns a JSON object containing the dancer's preferred name, pronouns, and pronunciation, along within their profile link if the user had set it to public

### JSON Response Format

```json
{
  "Matthew Emerick":
    {
      "preferred_name":"Matt",
      "pronunciation":"", # empty string if not set
      "pronouns":"He/Him/His",
      "profile_link":"https://db.lilacdancecenter.com/profiles/1"
      }
}

```

# API Documentation: Get PPS Information

## Endpoint

**URL**:

```
https://db.lilacdancecenter.com/api/pps_comps
https://db.lilacdancecenter.com/api/pps_events

```

**Method**:  
`GET`

---

## Query Parameters

<table id="bkmrk-parameter-type-descr"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>`profile_id`</td><td>Integer</td><td>The profile\_id of user the token belogs to. Required</td></tr><tr><td>`token`</td><td>String</td><td>The user's tokens. Required.</td></tr><tr><td>`comp_id`</td><td>Integer</td><td>Comp ID that the user wants PPS data for. Only for /pps\_events</td></tr></tbody></table>

Example Request:

```
https://db.lilacdancecenter.com/api/pps_comps?profile_id=1&token=ThisIsAnAPIToken

```

```
https://db.lilacdancecenter.com/api/pps_events?profile_id=1&token=ThisIsAnAPIToken&comp_id=1178

```

---

## Response

##### /pps\_comps

The endpoint returns a JSON object of competition data from the beginning of the previous year (e.g. since 01-01-2025 assuming today is during 2026)

##### /pps\_events

The endpoint returns a JSON object containing PPS data for the requested competition.

### JSON Response Format

##### /pps\_comps

```json
{
  "1187":
    {
      "id":1187,
      "abbreviation":"ifb26",
      "comp_date":"2026-05-16T00:00:00.000-04:00",
      "location":"",
      "name":"Island Fantasy Ball (32nd year 2026",
      "source":"o2cm",
      "entry_count":171,
      "competitor_count":94
    },
    ...
}

```

##### /pps\_events

```json
  This is in the format requested by USA Dance.

```