# On-Chain Data

## Get OP\_RETURN Data by Transaction ID (BSV-only) <a href="#get-op_return-data-by-tx-hash" id="get-op_return-data-by-tx-hash"></a>

This endpoint returns `OP_RETURN` data as hex for each output in the transaction.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/opreturn
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/46c5495468b68248b69e55aa76a6b9ca1cb343bee9477c9c121358380e421ff3/opreturn"
```

{% endcode %}

{% code title="Example Response" %}

```json
[{
    "n": 2,
    "hex": "006a075354554b2e434f"
}]
```

{% endcode %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| txid      | Transaction ID.                     |


---

# 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.taal.com/core-products/whatsonchain/on-chain-data.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.
