# uDegen Verified Tokens API

The **Verified Tokens API** provides a complete directory of projects that have passed the uDegen organic review process. This endpoint is designed for developers who need accurate project metadata, branding, and social links to build integrated directories or portfolio tools.

***

### GET /api/coins

This public, read-only endpoint returns all projects currently marked as `isVerifiedProject === true`. It excludes all unreviewed or unverified assets to ensure data quality.

#### Request Details

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

#### Example Request

```
Bash
```

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

***

### Response Schema

#### 200 OK

Returns an array of verified project objects.

```
JSON
```

```
{
  "success": true,
  "data": [
    {
      "network": "ethereum",
      "address": "0xAbC123...def",
      "name": "SomeToken",
      "symbol": "STK",
      "logo": "https://example.com/logo.png",
      "urls": {
        "website": "https://sometoken.io",
        "twitter": "https://twitter.com/sometoken",
        "telegram": "https://t.me/sometoken"
      }
    },
    {
      "network": "solana",
      "address": "So1Ana...",
      "name": "AnotherCoin",
      "symbol": "ANC",
      "logo": null
    }
  ]
}
```

#### Data Details

* `logo`: Returns a `string` URL or `null` if no branding is available.
* `urls`: This object is omitted if no social links exist. If present, it contains only valid, non-empty URLs.
* **Supported URL Keys:** `website`, `telegram`, `twitter`, `discord`, `facebook`, `instagram`, `reddit`, `tiktok`, `github`.

***

### Use Cases

1. **Project Directories:** Fetch the dataset to render a browsable catalog of uDegen-verified assets with full branding and social links.
2. **Instant Search:** Load the dataset client-side to enable per-keystroke filtering and autocomplete without repeated API latency.
3. **Portfolio Enrichment:** Match user wallet addresses against our list to display rich metadata (logos, names) for verified holdings.
4. **Community Bots:** Integration for Telegram/Discord bots to display social links for verified projects upon user command.

***

### Example Integration (TypeScript)

```
TypeScript
```

```
type CoinUrls = Partial<{
  website: string; telegram: string; twitter: string;
  discord: string; facebook: string; instagram: string;
  reddit: string; tiktok: string; github: string;
}>;

type Coin = {
  network: string;
  address: string;
  name: string;
  symbol: string;
  logo: string | null;
  urls?: CoinUrls;
};

type CoinsResponse =
  | { success: true; data: Coin[] }
  | { success: false; error: string; };

async function fetchListedCoins(): Promise<Coin[]> {
  const res = await fetch("https://udegen.io/api/coins");
  const json: CoinsResponse = await res.json();

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

  return json.data;
}
```

***

#### Technical Implementation Notes

* **Clean URL Data:** Our backend uses a Zod transform to strip out null or empty URL fields. If a key like `twitter` exists in the response, you are guaranteed a valid URL string.
* **Cache Strategy:** The system uses the Redis key `coins:listed`. The first request after the 1-hour TTL triggers a database repopulation.
* **Payload Considerations:** Currently, this endpoint returns the entire verified dataset. Future versions may include pagination as the list of uDegen-verified projects grows.

***
