> For the complete documentation index, see [llms.txt](https://docs.fide.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fide.id/api.md).

# API

## API Resources

{% hint style="info" %}
<https://api.fide.id> is the GraphQL Endpoint. Query definitions coming soon!
{% endhint %}

## *A simple example of a "blockchain\_address" entity query*

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

### Try It Now!

{% embed url="<https://graphql-extractor-w72to35ypa-uc.a.run.app/>" %}

POST Endpint

```graphql
https://api.fide.id
```

\
Query

```graphql
query getEntity($fide_id: String, $blockchain_address: String) {
  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {
    blockchain_addresses
    links
    fide_id
  }
}
```

Variables

```graphql
{
    "blockchain_address": "0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e"
}
```

Headers

```graphql
{
    "x-api-key": "YOUR_API_KEY"
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("x-api-key", "YOUR_API_KEY");

var graphql = JSON.stringify({
  query: "query getEntity($fide_id: String, $blockchain_address: String) {\r\n  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {\r\n    blockchain_addresses\r\n    links\r\n    fide_id\r\n  }\r\n}",
  variables: {"blockchain_address":"0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e"}
})
var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: graphql,
  redirect: 'follow'
};

fetch("https://api.fide.id", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="cURL" %}

```javascript
curl --location 'https://api.fide.id' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '{"query":"query getEntity($fide_id: String, $blockchain_address: String) {\r\n  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {\r\n    blockchain_addresses\r\n    links\r\n    fide_id\r\n  }\r\n}","variables":{"blockchain_address":"0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e"}}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.fide.id"

payload = "{\"query\":\"query getEntity($fide_id: String, $blockchain_address: String) {\\r\\n  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {\\r\\n    blockchain_addresses\\r\\n    links\\r\\n    fide_id\\r\\n  }\\r\\n}\",\"variables\":{\"blockchain_address\":\"0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e\"}}"
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.fide.id");
request.Headers.Add("x-api-key", "YOUR_API_KEY");
var content = new StringContent("{\"query\":\"query getEntity($fide_id: String, $blockchain_address: String) {\\r\\n  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {\\r\\n    blockchain_addresses\\r\\n    links\\r\\n    fide_id\\r\\n  }\\r\\n}\",\"variables\":{\"blockchain_address\":\"0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e\"}}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

```

{% endtab %}

{% tab title="Go" %}

```
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.fide.id"
  method := "POST"

  payload := strings.NewReader("{\"query\":\"query getEntity($fide_id: String, $blockchain_address: String) {\\r\\n  entity(input:{fide_id:$fide_id, blockchain_address: $blockchain_address}) {\\r\\n    blockchain_addresses\\r\\n    links\\r\\n    fide_id\\r\\n  }\\r\\n}\",\"variables\":{\"blockchain_address\":\"0x0fb213a1af101b1429e6ad3020ad92fb0d25eb1e\"}}")

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("x-api-key", "YOUR_API_KEY")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}

{% content-ref url="/pages/2YravcNWM4BDicRl8kPV" %}
[Entity Schema](/api/entity-schema.md)
{% endcontent-ref %}

{% content-ref url="/pages/FoTYhx6YtWcDAUhviZrs" %}
[Source Schema](/api/source-schema.md)
{% endcontent-ref %}

{% content-ref url="/pages/x5eaHDSx4K3kPwpnNQVa" %}
[Contribution Schema](/api/contribution-schema.md)
{% endcontent-ref %}

{% content-ref url="/pages/zOy5v9Qsipp2PivRHE9g" %}
[Authentication](/api/authentication.md)
{% endcontent-ref %}

{% content-ref url="/pages/td13xATvnRnnXbJTiu36" %}
[Legacy Endpoints](/api/legacy-endpoints.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fide.id/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
