# GetDataFromFilecoin

## Description

This query will allow one to search Filecoin directly for data

### Arguments

| Input | Description                                     |
| ----- | ----------------------------------------------- |
| `cid` | The content addressable identifier of the asset |

### Response Details

{% hint style="info" %}
Note that if the CID you passed as an argument is pointing to an archive of data, all individual files will be returned in the response
{% endhint %}

| Detail              | Description                                                                                                                                                                                                                                                                     |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `providerId`        | The `cid` pertaining to the asset retrieved                                                                                                                                                                                                                                     |
| `data`              | <p>The stored data represented as a <code>string</code><br><br>In the case of the data being <code>JSON</code>, <code>TEXT</code> or <code>HTML</code> the data will be returned as a string.  In all other cases, the data will be returned as a url pointing to the asset</p> |
| `url`               | The url pointing to the asset on the Filecoin gateway.                                                                                                                                                                                                                          |
| `provider`          | The web3 storage solution the data is stored.  In this case, `FILECOIN`                                                                                                                                                                                                         |
| `creationTimestamp` | The creation timestamp of the data                                                                                                                                                                                                                                              |

### Sample Query

```graphql
query {
  GetDataFromFilecoin(cid: "bafybeigom7fivisf3c43btyn6foza2ciavlsjqlh5hd3uguc56we7hujaa") {
    providerId
    url
    data
    metadata {
      name
      value
    }
    provider
    creationTimestamp
  }
}
```

### Sample Response

```json
{
  "data": {
    "GetDataFromFilecoin": [
      {
        "providerId": "bafkreiem2a3z5udj53fgob3iogusxi3h6nptnbvqwnc7vfwtd25navhvhu",
        "url": "https://gateway.ipfs.io/ipfs/bafkreiem2a3z5udj53fgob3iogusxi3h6nptnbvqwnc7vfwtd25navhvhu/test-upload.json",
        "data": "{\n\"image\": \"https://moonrunners.herokuapp.com/api/7_7 - Waning Crescent Moon/image\",\n\"name\": \"Moonrunners #7\",\n\"description\": \"A collection of 10,000 PFPs. Free mint. No discord. No roadmap. CCO. Protect the Moonrunners at all costs.\",\n\"attributes\": [\n{\n\"trait_type\": \"Background\",\n\"value\": \"Pink\"\n},\n{\n\"trait_type\": \"Body\",\n\"value\": \"Brave\"\n},\n{\n\"trait_type\": \"Fur\",\n\"value\": \"Green\"\n},\n{\n\"trait_type\": \"Outerwear\",\n\"value\": \"Gold Chain\"\n},\n{\n\"trait_type\": \"Mouth\",\n\"value\": \"Dribble\"\n},\n{\n\"trait_type\": \"Eyes\",\n\"value\": \"Angry Grey\"\n},\n{\n\"trait_type\": \"Headwear\",\n\"value\": \"Eagle\"\n},\n{\n\"trait_type\": \"Moon Cycle\",\n\"value\": \"Default Moon Cycle\"\n}\n],\n\"dna\": \"0c622ed13d00fe79a2345abbd9fa09185a68cc1a\"\n}\n",
        "metadata": [],
        "provider": "FILECOIN",
        "creationTimestamp": "2022-11-30T04:30:48Z"
      }
    ]
  }
}
```


---

# 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.storedat.io/reference/api-reference/query/getdatafromfilecoin.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.
