# Oracle & HTTP Call

An oracle helps you to do external HTTP calls to an API.

* You can register an oracle with only one line of code:

```
// SYNTAX
oracle(name, permission, base_url).

// EXAMPLE
oracle(coindesk, r, 'api.coindesk.com/v1/bpi').
```

{% hint style="warning" %}

* The oracle`name`must be in *snake\_case* **OR** *camelCase*

* The second parameter should always b&#x65;**`r`**(only *READ* permission is available ATM)
  {% endhint %}

* Then, you must use the ***get\_http()*** predicate whenever you want to get data from the oracle:

```
// SYNTAX
get_http(oracle_name, path, Output).

// EXAMPLE
prompt :-
    get_http(coindesk, '/currentprice.json', Output),
    set(coindesk, Output).
```

{% hint style="warning" %}
The Output name must be in **PascalCase.**
{% endhint %}


---

# 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://hyperdapp.gitbook.io/code-editor/guides/oracle-and-http-call.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.
