LogoLogo
  • What is the Rareful API?
  • Quick Start
  • Reference
    • API Reference
      • Smart Contracts and Collections
      • Wallets and Users
      • Minting and File Upload
      • Getting NFT Metadata
      • Buying, Selling, and Transfers
    • About NFTs and Smart Contracts
      • NFTs
      • Smart Contracts
      • Our Smart Contracts
Powered by GitBook
On this page
  • Get your API keys
  • Make your first request
  • Test your API connection

Quick Start

The Rareful API is a complete toolkit to power rich NFT experiences inside apps and games

Good to know: Use this quick start to get up and running in a few steps. Once you've confirmed your authenticated and can make a successful test request, move on to the API Reference.

Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include a valid API key in the header will not be authorized.

Login at api.rareful.io and go to the profile tab to get your api key.

Make your first request

To make your first request, send an authenticated request to the testConnection endpoint. This will check to see if you're connected and ready to dive in to more documentation.

Test your API connection

POST https://api.rareful.io/v1/testConnection

Tests your API_KEY to see if you are connected. Remember that post requests with no parameters still need an empty body like this: {}

{
    "data": {
        "Authenticated": True
    },
    "status": 200,
    "message": "Congrats you're Authenticated and ready to make requests!"
}
{
    "data": {},
    "status": 400,
    "message": "There was an error"
}
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}

Take a look at how you might call this method using different languages and request packages:

import requests
import json

API_KEY = "Set your API KEY from your dashboard here"
url = "https://api.rareful.io/v1/testConnection"

payload = json.dumps({})
headers = {
  'API_KEY': API_KEY,
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
var request = require('request');
var API_KEY = "Set your API KEY from your dashboard here"
var options = {
  'method': 'POST',
  'url': 'https://api.rareful.io/v1/testConnection',
  'headers': {
    'API_KEY': API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({})

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
 curl --location --request POST 'https://api.rareful.io/v1/testConnection' \
--header 'API_KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{}'

import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var API_KEY = "Set your API KEY from your dashboard here"
var semaphore = DispatchSemaphore (value: 0)

let parameters = "{}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.rareful.io/v1/testConnection")!,timeoutInterval: Double.infinity)
request.addValue(API_KEY, forHTTPHeaderField: "API_KEY")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()
PreviousWhat is the Rareful API?NextAPI Reference

Last updated 2 years ago