> For the complete documentation index, see [llms.txt](https://docs.bloqifi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bloqifi.com/reference/retrieval/web.md).

# Web

Making an call to the web endpoint

## Fetch website from blockchain

Retrieve a website based on the blockchain and transaction id's (txid) provided.

## Retrieve website

<mark style="color:green;">`POST`</mark> `https://api.bloqifi.com/v0/web`

Retrieve a website

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                         | Type   | Description                                |
| -------------------------------------------- | ------ | ------------------------------------------ |
| txids<mark style="color:red;">\*</mark>      | Array  | List of transaction id's \[`'123', '321']` |
| blockchain<mark style="color:red;">\*</mark> | String | `Bloqcoin`, `Dogecoin`, `Bitcoin`          |

{% tabs %}
{% tab title="200: OK " %}
Brotli compressed data if there is Content-Encoding support, otherwise raw text/html

```javascript
text/html
```

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}
{% endtabs %}

The web endpoint will take all the transaction ids provided, merge the received hex strings containing OP\_RETURN together and combine these into the final content. Bloqcoin is the obvious choice, as it supports 102480; //!< bytes (+1 for OP\_RETURN, +2 for the pushdata opcodes). And as such can host an entire website in one transaction id.

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const rawResponse = await fetch('https://api.bloqifi.com/v0/web', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    blockchain: 'Bloqcoin',
    txids: ['123', '321']
  })
});

const data = await rawResponse.text();

if (rawResponse.status === 200) {

  // data contains the raw data
}
```

{% endtab %}

{% tab title="curl" %}

```
curl -X POST https://api.bloqifi.com/v0/web \
-H "Content-Type: application/json" \
-d '{"blockchain": "Bloqcoin", "txids": ["123", "321"]}' 
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** Notice that the Blockchain used is capitalized, this is required.

In the example we will be using `Bloqcoin`, other supported blockchains are:

`Dogecoin`, `Bitcoin`
{% endhint %}

Let’s consider what the output of our response should look like:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My Blockchain Website</title>
  </head>
  <body>
  	Hello World..
  </body>
</html>
```

If the browser or client is capable of decompressing `Brotli`, then a compressed version of the output is delivered as the content is already compressed in the blockchain.

### Fetch website from IPFS

Retrieve a website based on the hash provided.

## Retrieve website

<mark style="color:blue;">`GET`</mark> `https://storage.bloqifi.com/ipfs/CID`

Retrieve a website

{% tabs %}
{% tab title="200: OK " %}
Brotli compressed data if there is Content-Encoding support, otherwise raw text/html

```javascript
text/html
```

{% endtab %}
{% endtabs %}

```
<!-- Directly in a browser supporting IPFS -->

ipfs://QmT1khGw2JNrQYh1XLdiZVBZHhwtwms2tKeKz4TF7UDG2Y
```

```
<!-- Using Bloqifi IPFS Gateway -->

https://storage.bloqifi.com/ipfs/QmT1khGw2JNrQYh1XLdiZVBZHhwtwms2tKeKz4TF7UDG2Y
```

## Configure a custom domain name for your IPFS

If you'd prefer to use a friendly DNS name for your website, such as [www.example.com](http://www.example.com), instead of the default DNS name. You can create a custom domain name and associate it with the DNS name.&#x20;

When a client makes a request using this custom domain name, the DNS server resolves it to the DNS name for your IPFS content.

```
<!-- If apps and libraries force-lowercase on URIs,
you can substitute the IPFS hash for object id -->

ObjectID.storage.bloqifi.com.
```

Next, use your DNS service, such as your domain registrar, to create a CNAME record to route queries to your IPFS content. For more information, see the documentation for your DNS service.
