RadixAPI
  • RadixAPI
  • ❓HowTo
    • Get access
    • Authenticate
    • Fetch data
    • Use Stokenet
    • Use ROLA
    • Use Listing feature
    • Use Gateway Service
    • Contact us
  • 💲Pricing and conditions
    • API plans
    • Payment
    • Consuming credits
    • Validity and expiration
    • Renewal & Termination
  • ↔️Data
    • Ledger data
    • Prices
    • Supply (listing)
  • 🛣️Roadmap
    • Improved regional support
    • Feature Request
    • Change log
Powered by GitBook
On this page
  1. HowTo

Fetch data

Visit https://api.radixapi.net/docs to find a list of all publicly available endpoints including examples and https://stokenet.radixapi.net/docs for the ones on the Radix test network.

When you use the "Try out" feature, the related curl command will also be shown to you.

Javascript example:

export const getData = async () => {
  const requestOptions = {
    method: "GET",
    headers: {
      accept: "application/json",
      "Content-Type": "application/json",
      Authorization: "Bearer hjfdlsöfods_8i89673fds-fdsrfsd",
    },
  };

  try {
    const result = await fetch(
      "https://api.radixapi.net/v1/route/endpoint",
      requestOptions
    ).then((res) => res.json());

    if (result.code === 200) {
      return result.data;
    } else return -1;
  } catch (error) {
    console.log("Error during data fetch: ", error);
    return -1;
  }
};

You can connect to the WebSocket by using the following command:

wss://api.radixapi.net/v1/transactions?bearer_token=xyz_N0tAVal1d_beAr3r
PreviousAuthenticateNextUse Stokenet

Last updated 4 months ago

❓