> For the complete documentation index, see [llms.txt](https://zapproject.gitbook.io/zapproject/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zapproject.gitbook.io/zapproject/users/using.md).

# Getting data from Oracles

Users can utilize purchased data from Zap Oracles in their dapps or apps. Zap provides templates for offchain and onchain solutions

{% hint style="info" %}

#### Zap Oracles will need to define the data structure they provide in their responses. Users can look up the information in <https://admin.zap.org> or Oracle's own source if they provide one.

{% endhint %}

## Onchain solution&#x20;

Dapps can receive data from Zap Oracles by simply implementing callback method that match the data type users expect from the Oracle.  Zap platform provides multiple types of responses :&#x20;

| Response method       | Response Type                      | Callback to implement              |
| --------------------- | ---------------------------------- | ---------------------------------- |
| `respondBytes32Array` | `bytes32[]`                        | `callback(id, response)`           |
| `respondIntArray`     | `int[]`                            | `callback(id, response)`           |
| `respond1`            | `string`                           | `callback(id, response1)`          |
| `respond2`            | `(string, string)`                 | `callback(id, response1, 2)`       |
| `respond3`            | `(string, string, string)`         | `callback(id, response1, 2, 3, 4)` |
| `respond4`            | `(string, string, string, string)` | `callback(id, response1, 2, 3, 4)` |

{% hint style="info" %}
Check out [Onchain subscriber example](/zapproject/users/templates/offchain-subscrier-example.md) for solidity code example of dapps that use data from Zap Oracles
{% endhint %}

## Offchain solution

If User's address is not a contract address, all above response method will automatically emit Event of responses instead of calling callback method. User can listen to Events for each method to receive data offchain. Following table includes all offchain events with response method

| Response method   | Event                 |
| ----------------- | --------------------- |
| `respondBytes32`  | `OffchainResponse`    |
| `respondIntArray` | `OffchainResponseInt` |
| `respond1`        | `OffchainResult1`     |
| `respond2`        | `OffchainResult2`     |
| `respond3`        | `OffchainResult3`     |
| `respond4`        | `OffchainResult4`     |

{% hint style="info" %}
Check out [Offchain Subscriber Example](/zapproject/users/templates/offchain-subscrier-example.md) for code example of receiving offchain responses
{% endhint %}
