# API

Third-party developers can easily connect their applications to Degens in Space by using our public API.

**`Endpoint:`**` ``https://api.degens.space`

## Get item's traits

<mark style="color:green;">`GET`</mark> `/getItem`

Returns an item json object based on a block number.

**URL parameter**

| Name  | Value                        |
| ----- | ---------------------------- |
| block | `Block number to be fetched` |

**Response**

{% tabs %}
{% tab title="200" %}

```json
[
    {
    "id":"316512",
    "name":"Human Replicant Shield Defense",
    "traits":{
        "type":"defense",
        "modifier_types":[
            "Human",
            "Replicant"
        ],
        "modifier_skills":[
            "Stamina",
            "Computation"
        ],
        "sub_type":"Shield",
        "power":1,
        "cooldown":0
        }
    }
]
```

{% endtab %}
{% endtabs %}

## Get pilot's traits

<mark style="color:green;">`GET`</mark> `/getTraits`

Returns an item json object based on a block number.

**URL parameter**

| Name  | Value                        |
| ----- | ---------------------------- |
| block | `Block number to be fetched` |

**Response**

{% tabs %}
{% tab title="200" %}

```json
"traits":[
    {
    "type":"species",
    "name":"venusian",
    "effects":
        [
            {
            "skill":"magic",
            "effect":5
            }
        ]
    },
    {
    "type":"gender",
    "name":"male",
    "effects":
        [
            {
            "skill":"stamina",
            "effect":3
            }
        ]
    },
    {
    "type":"head",
    "name":"camera",
    "effects":
        [
            {
            "skill":"computation",
            "effect":4
            }
        ]
    },
    {
    "type":"eyes",
    "name":"laser",
    "effects":
        [
            {
            "skill":"computation",
            "effect":5
            }
        ]
    },
"name":"venusian magician script kid #123456",
"id":"123456"
```

{% endtab %}
{% endtabs %}

## Get pilot's image

<mark style="color:green;">`GET`</mark> `/getPilotImage`

Returns a pilot image based on a block number.

**URL parameter**

| Name  | Value                        |
| ----- | ---------------------------- |
| block | `Block number to be fetched` |

**Response**

{% tabs %}
{% tab title="200" %}

```svg
SVG object
```

{% endtab %}
{% endtabs %}

## Get item's image

<mark style="color:green;">`GET`</mark> `/getItemImage`

Returns an item image based on a block number.

**URL parameter**

| Name  | Value                        |
| ----- | ---------------------------- |
| block | `Block number to be fetched` |

**Response**

{% tabs %}
{% tab title="200" %}

```svg
SVG object
```

{% endtab %}
{% endtabs %}


---

# 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://guide.degens.space/technical/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.
