# GetDataFromArweave

## Description

This query will allow one to search arweave directly for data in bulk.  It queries both the Arweave GraphQL API and the Arweave Gateway to be able to return data in one call instead of having to first search for the transaction id and then querying the gateway

### Arguments

| Input                 | Description                                                                                                                                    |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `targetWalletAddress` | The target wallet address the data belongs to                                                                                                  |
| `metadata`            | An array of key/value pairs representing tags in the Arweave ecosystem allowing one to filter a search                                         |
| `sort`                | <p>Used to specify a sort order by block inclusion time.  </p><p></p><p>Defaults to descending order </p>                                      |
| `limit`               | <p>The number of results to return:  Minimum is 1 and maximum is 10<br><br>Note:  The maximum limit will look to be expanded in the future</p> |

### Response Details

<table><thead><tr><th width="330.5">Detail</th><th>Description</th></tr></thead><tbody><tr><td><code>providerId</code></td><td>The transaction id pertaining to the asset retrieved</td></tr><tr><td><code>data</code></td><td>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</td></tr><tr><td><code>url</code></td><td>The url pointing to the asset on the Arweave gateway</td></tr><tr><td><code>metadata</code></td><td>An array of key/value pairs representing tags</td></tr><tr><td><code>provider</code></td><td>The web3 storage solution the data is stored.  In this case, <code>ARWEAVE</code></td></tr><tr><td><code>creationTimestamp</code></td><td>The block creation timestamp of the data</td></tr></tbody></table>

### Sample Query

```graphql
query {
  GetDataFromArweave(
    targetWalletAddress: "FWh7-V_t6BHFNwoTLpQOj3w62TxXE7teHW9opgrCMqE"
    metadata: [{ name: "category", value: "general" }]
    sort: ASC
    limit: 3
  ) {
    providerId
    provider
    data
    url
    metadata {
      name
      value
    }
    creationTimestamp
  }
}
```

### Sample Response

```json
{
  "data": {
    "GetDataFromArweave": [
      {
        "providerId": "-Hs6t54QWPBi8ICvnQlArymBt03oOdsdBNpYqPgb6CE",
        "provider": "ARWEAVE",
        "data": "{\"Content-Type\":\"application/json\",\"term\":\"whale\",\"description\":\"A term for an individual holding a large amount of cryptocurrency.\",\"locale\":\"en\",\"source\":\"GLOSSETA\",\"category\":\"general\"}",
        "url": "https://www.arweave.net/-Hs6t54QWPBi8ICvnQlArymBt03oOdsdBNpYqPgb6CE",
        "metadata": [
          {
            "name": "Content-Type",
            "value": "application/json"
          },
          {
            "name": "term",
            "value": "whale"
          },
          {
            "name": "description",
            "value": "A term for an individual holding a large amount of cryptocurrency."
          },
          {
            "name": "locale",
            "value": "en"
          },
          {
            "name": "source",
            "value": "GLOSSETA"
          },
          {
            "name": "category",
            "value": "general"
          }
        ],
        "creationTimestamp": "2021-10-24T05:08:07+00:00"
      },
      {
        "providerId": "rEgp75_wUWe-B-wsfsWIZqjxPRsnJlDOuWU9Qh-2qzc",
        "provider": "ARWEAVE",
        "data": "{\"Content-Type\":\"application/json\",\"term\":\"hodl\",\"description\":\"An acronym for hold on for dear life (equivalent to HOLD) often used to encourage people not to sell cryptocurrency impulsively on huge swings in price.\",\"locale\":\"en\",\"source\":\"GLOSSETA\",\"category\":\"general\"}",
        "url": "https://www.arweave.net/rEgp75_wUWe-B-wsfsWIZqjxPRsnJlDOuWU9Qh-2qzc",
        "metadata": [
          {
            "name": "Content-Type",
            "value": "application/json"
          },
          {
            "name": "term",
            "value": "hodl"
          },
          {
            "name": "description",
            "value": "An acronym for hold on for dear life (equivalent to HOLD) often used to encourage people not to sell cryptocurrency impulsively on huge swings in price."
          },
          {
            "name": "locale",
            "value": "en"
          },
          {
            "name": "source",
            "value": "GLOSSETA"
          },
          {
            "name": "category",
            "value": "general"
          }
        ],
        "creationTimestamp": "2021-10-24T05:08:07+00:00"
      },
      {
        "providerId": "rJV_2_Lp3sMZPjjNW6LAbiowSk0MDQRPadJ33JTPwrw",
        "provider": "ARWEAVE",
        "data": "{\"Content-Type\":\"application/json\",\"term\":\"blockchain\",\"description\":\"A publicly-accessible digital ledger used to store and transfer information without the need for a central authority. Blockchains are the core technology on which cryptocurrency protocols like Bitcoin and Ethereum are built.\",\"locale\":\"en\",\"source\":\"GLOSSETA\",\"category\":\"general\"}",
        "url": "https://www.arweave.net/rJV_2_Lp3sMZPjjNW6LAbiowSk0MDQRPadJ33JTPwrw",
        "metadata": [
          {
            "name": "Content-Type",
            "value": "application/json"
          },
          {
            "name": "term",
            "value": "blockchain"
          },
          {
            "name": "description",
            "value": "A publicly-accessible digital ledger used to store and transfer information without the need for a central authority. Blockchains are the core technology on which cryptocurrency protocols like Bitcoin and Ethereum are built."
          },
          {
            "name": "locale",
            "value": "en"
          },
          {
            "name": "source",
            "value": "GLOSSETA"
          },
          {
            "name": "category",
            "value": "general"
          }
        ],
        "creationTimestamp": "2021-10-24T05:08:07+00:00"
      }
    ]
  }
}
```
