# uDegen Score API

The **uDegen API** allows developers, third-party dashboards, and bots to integrate our proprietary scoring data and latest verifications into their own platforms. Our public endpoints provide a streamlined way to access real-time intelligence across all supported networks.

***

### GET /api/coins/score

This is a public, read-only endpoint that returns the total score for every coin currently indexed in the uDegen database.

#### Request Details

* **Method:** `GET`
* **Authentication:** None required.
* **Query Parameters:** None.
* **Caching:** Results are cached in **Redis** for **1 hour** (`TTL: 3600s`).

#### Example Request

```
Bash
```

```
curl https://udegen.io/api/coins/score
```

***

#### Response Schema

**200 OK**

Returns a list of all coin scores. A `totalScore` of `null` indicates the coin has been indexed but has not yet completed the scoring process.

```
JSON
```

```
{
  "success": true,
  "data": [
    {
      "network": "ethereum",
      "address": "0xAbC123...def",
      "totalScore": 87.5
    },
    {
      "network": "solana",
      "address": "So1Ana...",
      "totalScore": null
    }
  ]
}
```

**500 Internal Server Error**

Returned if a server-side error occurs during data retrieval.

```
JSON
```

```
{
  "success": false,
  "error": "Internal Server Error"
}
```

***

#### Use Cases

1. **Leaderboards:** Fetch the dataset and sort client-side by `totalScore` to render a ranked list of top-performing projects.
2. **Portfolio Overlays:** Cross-reference a user's holdings (via `network` + `address`) to display uDegen Scores directly inside a wallet UI.
3. **External Bots:** Telegram or Discord bots can poll this endpoint hourly to alert communities of score changes or new high-score listings.

***

#### Example Integration (TypeScript)

```
TypeScript
```

```
type CoinScore = {
  network: string;
  address: string;
  totalScore: number | null;
};

type ScoreResponse =
  | { success: true; data: CoinScore[] }
  | { success: false; error: string };

async function fetchCoinScores(): Promise<CoinScore[]> {
  const res = await fetch("https://udegen.io/api/coins/score");
  const json: ScoreResponse = await res.json();

  if (!json.success) throw new Error(json.error);

  return json.data;
}
```

***

#### Technical Implementation Notes

* **Data Integrity:** All responses are validated against a Zod discriminatedUnion schema server-side, ensuring consumers receive strictly typed data.
* **Performance:** To ensure maximum speed, the first request after cache expiry repopulates Redis. We recommend that high-frequency integrators respect the 1-hour TTL to avoid unnecessary load.
* **Response Size:** This endpoint currently returns *all* scored coins in a single payload. As our database expands, pagination or filtering parameters may be introduced to maintain performance.

***


---

# Agent Instructions: 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:

```
GET https://docs.utopiabnb.com/udegen/api/udegen-score-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
