Skip To Content

Blockdaemon Documentation

Swagger (Quick Start)

Overview
1. Generate a Ubiquity API Key on Blockdaemon App
2. Authorize a Request with Ubiquity
3. Send a Request with Ubiquity
4. Receive a Response


Overview

This guide allows you to quickly get started with Ubiquity.

Within this guide, we recommend using the Ubiquity Swagger API specification as the easiest way to get started. Alternative clients and methods of access are available: see quick start guides for other tools.


1. Generate a Ubiquity API Key on Blockdaemon App

To use the Ubiquity API, you need to get the API access key. This is a 47-character unique number.

To generate a Ubiquity API key, sign up to the Blockdaemon application and take the following steps:

  1. Navigate to Ubiquity API > Connect > API Keys
  2. Click on Create API Key
  3. In the pop-up window, enter your desired Key Name
  4. Click on the Create API Key button to generate the key
  5. Click on your key to copy it

Check out our video guide on creating your Ubiquity API Key

Please note:

  • If you lose the key, you will not be able to retrieve it.
  • You should immediately store your key in a secure place.

2. Authorize a Request with Ubiquity

You need to authorize your request before sending.

  1. Go to Ubiquity Swagger API
  2. Scroll the page down to see Ubiquity endpoints
  3. Click on the Authorize button right above the endpoints
  4. In the pop-up window, paste your API key in the Value input box
    Note: You can use any authorization option — for example, bearerAuth
  5. Click on Authorize
  6. Click on Close

The Authorize button in the Ubiquity Swagger API specification

Authorizing a request in the Ubiquity Swagger API specification (via a Bearer token)


3. Send a Request with Ubiquity

This example uses Ubiquity to get the current block number in Ethereum Mainnet:

  1. Scroll down to the Sync section
  2. Click on /v1/{protocol}/{network}/sync/block_number
  3. Select Ethereum in the platform drop-down menu
  4. Make sure that network is set to Mainnet
  5. Click on the Try it out button
  6. Click on the Execute button that appears below

Executing a request in the Ubiquity Swagger API specification


4. Receive a Response

The API response is displayed below the Execute button, in the Responses section:

Receiving a response in the Ubiquity Swagger API specification (the current block number)

Please note that Swagger generates a cURL example and a request URL, which you can use with other tools:

cURL

curl -X GET "https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/sync/block_number" -H  "accept: application/json" -H  "Authorization: Bearer YOUR_API_KEY"

Request URL

https://svc.blockdaemon.com/universal/v1/ethereum/mainnet/sync/block_number

The received output contains the current block number for Ethereum Mainnet:

15521127

Learn more about the endpoint: GET Current Block Number

We don't support Internet Explorer

Please use Chrome, Safari, Firefox, or Edge to view this site.