Bloqifi RESTful API documentation
  • The Next Generation Web³
  • Quick Start
  • Blog
  • Reference
    • API Reference
      • Authentication
      • Bloq
      • Payment
      • Transaction
      • Rates
    • Retrieval
      • Transaction ID
      • Web
      • Blob
      • Chunk
  • Stripe Metered Billing
    • API Reference
      • Subscribe
      • Check Usage
Powered by GitBook
On this page
  • Install the library
  • Make your first request
  • Retrieve website

Was this helpful?

Quick Start

Good to know: This quick start guide can be good to help you get up and running with our RESTful API in a few steps. Some people prefer diving in with the basics rather than meticulously reading every page of documentation!

Install the library

The best way to interact with our RESTful API is to use one of our official libraries:

# Install via NPM
npm i -g bloqifi

Make your first request

To make your first request, send an request to the web endpoint. This will receive a website bloq, based on the blockchain and transaction id (txid) provided.

Retrieve website

POST https://api.bloqifi.com/v0/web

Retrieve a website

Headers

Name
Type
Description

Accept*

String

application/json

Content-Type*

String

application/json

Request Body

Name
Type
Description

txids*

Array

List of transaction id's ['123', '321']

blockchain*

String

Bloqcoin, Dogecoin, Bitcoin, IPFS

Brotli compressed data if there is Content-Encoding support, otherwise raw text/html

text/html

Good to know: Notice that the Blockchain used is capitalized, this is required.

In the example we will be using Bloqcoin

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

const rawResponse = await fetch('https://api.bloqifi.com/v0/web', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    '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
}
curl -X POST https://api.bloqifi.com/v0/web \
-H "Content-Type: application/json" \
-d '{"blockchain": "Bloqcoin", "txids": ["123", "321"]}' 

If the website byte size is larger then 80 bytes, it will be split up in chunks and added to the blockchain in multiple transactions ids. However in the case of Bloqcoin, a website can be as large as 20480; //!< bytes (+1 for OP_RETURN, +2 for the pushdata opcodes) and in most cases only require one transaction id.

PreviousThe Next Generation Web³NextBlog

Last updated 2 years ago

Was this helpful?