Getting Started with the Metrics API

This guide will help you quickly integrate the Bilanc Metrics API into your applications.

API Basics

Example Requests

Here are some common examples to help you get started:

const axios = require('axios');

async function getMetrics() {
  try {
    const response = await axios.post('https://api.bilanc.co/metrics/v2/pull-requests-count', {
      filters: {
        repository_id: "123456"
      },
      group_by: ["repository_name"],
      date_level: "month",
      aggregation: "count",
      date_field: "created_at"
    }, {
      headers: {
        'Authorization': 'Bearer YOUR_AUTH_TOKEN',
        'Content-Type': 'application/json'
      }
    });
    
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error('Error fetching metrics:', error);
  }
}

Available Metrics

Bilanc provides a wide range of metrics across several categories: