Pre-score endpoint allows you to query for RociFi credit score and list of associated features for any address across Ethereum and supported L2s including Polygon, Arbitrum, Fantom, BNB Smart Chain and Optimism.

Here is the JS code you can use to connect to the API:

const json = await fetch(
    "<https://v2.rociapi.com/pre_score/{Address}>",
    {
      headers: {
        Accept: "application/json",
        Authorization:
          "Bearer {Token}",
      },
    }
  );
  console.log(await json.json());

Please replace {Address} with the address you want to score and {Token} with your API token.

Example of response:

{
  "features": {
    "count_borrow": 28,
    "total_borrow": 7.4000445605296505,
    "count_repay": 7,
    "total_repay": 6.628156577119262,
    "count_liquidation": 0,
    "total_liquidation": 0,
    "count_deposit": 28,
    "total_redeem": 29.354375920147884,
    "days_since_first_borrow": 547
  },
  "address": "0x0e5Df087b286431F7fc49af2885A49A0A573416F",
  "credit_score": 6,
  "feature_generator_version": "9.0.0"
}

Reach out to RociFi team on Discord to get API token. API is free.