> For the complete documentation index, see [llms.txt](https://solfuse.gitbook.io/solfuse/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solfuse.gitbook.io/solfuse/information/api-and-code-examples.md).

# API & Code Examples

Solfuse offers an **API** for retrieving AI-generated insights, voting data, and project details. This allows third-party developers to build integrations, dashboards, or analytics tools.

#### Example REST Endpoint

* **GET** `/api/v1/projects/{projectId}`
  * **Description**: Retrieve the latest AI evaluation, votes, and performance metrics for a given project.

> **Curl Example**
>
> ```bash
> bashCopy codecurl -X GET "https://api.solfuse.io/api/v1/projects/1234" \
>   -H "Authorization: Bearer <YOUR_API_KEY>"
> ```
>
> **Response**:
>
> ```json
> jsonCopy code{
>   "projectId": "1234",
>   "name": "FutureAI Robotics",
>   "riskScore": 0.2,
>   "votes": {
>     "support": 405,
>     "against": 29
>   },
>   "status": "Live"
> }
> ```

#### Example JavaScript Snippet

> ```javascript
> javascriptCopy codeasync function getProjectData(projectId) {
>   const response = await fetch(`https://api.solfuse.io/api/v1/projects/${projectId}`, {
>     headers: {
>       'Authorization': 'Bearer <YOUR_API_KEY>',
>     },
>   });
>   const data = await response.json();
>   return data;
> }
>
> // Usage:
> getProjectData(1234).then(project => {
>   console.log('Project Name:', project.name);
>   console.log('Risk Score:', project.riskScore);
> });
> ```
