Introduction

To get started with the API, you need to use the base url together with an authorization token provided in the header.

Disclaimer
The API is currently in beta.

This means that the endpoints are subject to change or currently missing, some content might be missing (e.g. a description on highlights).

With that said, we'll make it our obligation to communicate any substantial changes before they take effect; we do this to reduce any frustrations that might arrive as a consequence of the changes we make. We hope that you in return will help us with valuable feedback on any trouble that you might experience so we can fix them or take them into consideration as we finish the API.

Authorization
The authorization token you need to use depends on what type of request you want to make. There is a user token that works as your identity. It is used to generate session tokens that are used to request data from the API: e.g. get financial information for a given company.

JWT
We use a JSON Web Token for authorization. This enables us to send a payload inside the session token with additional information like expiration. That enables you to check if your token is still valid without doing an additional request.

You can learn more about it here.

Headers
All the endpoints require an authorization token (user or session token) with the Authorization header. You should also specify the Content-Type header as "application/json", but this is the only supported format so consider it optional.

Versions
There is currently only one supported version: v1_1

Base URL

https://api.risika.dk/{version}

Headers

Authorization: <user_token or session_token>
Content-Type: "application/json"

Generate a session token

This endpoint generates a session token from your user token. This token allows you to make unlimited requests for 10 minutes, after this timeframe you need to generate a new one. You are allowed to have multiple active session tokens at the same time.

This system is intented to replace a rate limit.

GET
/access/refresh_token

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/access/refresh_token/ \
  --header 'Authorization: <user_token>'

Example response

{
  "token": "jwt eyJ0eXAiOiJKV1QiLCJhbG ..."
}

Company

These are all the endpoints that relates to the company itself. Here you will find basic information about the company: address, phone number, number of employees, etc. You will also find information about who is related to the company: the owners, board of directors, etc.

Basics

GET
/company/basics/{cvr}

Relations

GET
/company/relations/{cvr}

Company basics

This endpoint is used to get all the basic information about a given company. It will contain information such as address, phone number, number of employees, company name, etc.

GET
/company/basics/{cvr}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/company/basics/37677892/ \
  --header 'Authorization: <session_token>'

Example response

{
  "organization_id": null,
  "local_organization_id": {
    "country": "DK",
    "id": 37677892
  },
  "address": {
    "street": "Kronprinsessegade",
    "number": "26, st.",
    "zipcode": 1306,
    "city": "København K",
    "country": "DK"
  },
  "main_industry_code": {
    "code": 829100,
    "description": "Inkassovirksomhed og kreditoplysning"
  },
  "secondary_industry_codes": [
    {
      "industry_code": 631100,
      "industry_description": "Databehandling, webhosting og lignende serviceydelser",
      "priority": 1
    },
    {
      "industry_code": 620200,
      "industry_description": "Konsulentbistand vedrørende informationsteknologi",
      "priority": 2
    }
  ],
  "number_of_employees": {
    "interval": null,
    "source": null
  },
  "last_report_date": "2017-12-31",
  "date_of_incorporation": "2016-04-30",
  "company_type": {
    "short": "APS",
    "long": "Anpartsselskab"
  },
  "company_name": "RISIKA ApS",
  "holding_company": false,
  "powers_to_bind": "Virksomheden tegnes af et medlem af direktionen.",
  "status": "normal",
  "email": {
    "email": "hello@risika.dk",
    "hidden": true
  },
  "phone": {
    "phone_number": "42905757",
    "hidden": false
  },
  "advertisement_protection": false
}

Company relations

This endpoint is used to get all the relational information for a given company. You will get the owners, directors, together with a date for when the person got the role.

Example request

curl --request GET \
  --url 'https://api.risika.dk/v1_1/company/relations/37677892' \
  --header 'Authorization: <session_token>'

Example response

{
  "relations": [
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": null
      },
      "name": "Nicolai Rasmussen",
      "type": "PERSON",
      "function": "DIREKTION",
      "valid_from": "2018-04-01"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": null
      },
      "name": "Nicolai Rasmussen",
      "type": "PERSON",
      "function": "REEL EJER",
      "valid_from": "2018-04-01"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": null
      },
      "name": "Timm Jeppesen",
      "type": "PERSON",
      "function": "DIREKTION",
      "valid_from": "2018-04-01"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": null
      },
      "name": "Timm Jeppesen",
      "type": "PERSON",
      "function": "REEL EJER",
      "valid_from": "2017-05-18"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": null
      },
      "name": "M. Advice IVS",
      "type": "VIRKSOMHED",
      "function": "STIFTERE",
      "valid_from": "2016-04-30"
    }
  ]
}

Financial

These are all the endpoints for financial information. Here you will have access to the numbers from their financial report, key figures, information about the auditor and a link to their official financial report. We provide information from the three latest financial reports.

NOTE: the result from these endpoints cannot be expected to be sorted, you will need to handle this yourself. There is a date on all objects in the response.

Numbers

GET
/financial/numbers/{cvr}

Ratios

GET
/financial/ratios/{cvr}

Stats

GET
/financial/stats/{cvr}

Financial numbers

This endpoint provides you with all the relevant financial numbers for the most recent financial report for a given company.

GET
/financial/numbers/{cvr}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/financial/numbers/37677892/ \
  --header 'Authorization: <session_token>'

Example response

[
  {
    "period": {
      "start": "2016-07-01",
      "end": "2017-12-31"
    },
    "net_sales": null,
    "revenue": null,
    "gross_profit_loss": null,
    "gross_result": -114631,
    "raw_materials_and_consumables_used": null,
    "wages_and_salaries": null,
    "other_external_expenses": null,
    "other_operating_expenses": null,
    "tax_expense": -37216,
    "tax_expense_on_ordinary_activities": null,
    "other_income": null,
    "depreciation_amortisation_expense_and_impairment_losses_of_property_plant_and_equipment_and_intangible_assets_recognised_in_profit_or_loss": 56216,
    "depreciation_amortisation_expense_and_impairment_losses_of_property_plant_and_equipment_and_intangible_assets": null,
    "results_from_net_financials": null,
    "other_finance_income": null,
    "impairment_of_financial_assets": null,
    "rest_of_other_finance_expenses": null,
    "other_finance_expenses": null,
    "finance_income": null,
    "finance_costs": null,
    "profit_loss_before_tax": null,
    "profit_loss": -133631,
    "intangible_assets": 199881,
    "property_plant_and_equipment": null,
    "noncurrent_assets": 202381,
    "current_assets": 135966,
    "assets": 338347,
    "equity": 136369,
    "equity_and_liabilities": null,
    "liabilities_and_equity": 338347,
    "contributed_capital": 50000,
    "paid_contributed_capital": null,
    "retained_earnings": -289538,
    "revaluation_reserve": null,
    "proposed_dividend_recognised_in_equity": null,
    "reserve_for_net_revaluation_according_to_equity_method": null,
    "minority_interests": null,
    "longterm_equity_loan": null,
    "provisions": 43974,
    "liabilities_other_than_provisions": 158004,
    "shortterm_liabilities_other_than_provisions": 158004,
    "longterm_liabilities_other_than_provisions": null,
    "current_liabilities": null,
    "noncurrent_liabilities": null
  }
]

Financial ratios

This endpoint provides some ratios that we have calculated from their financial report. These include ratios like interest coverage, return on equity (ROE), return on investment (ROI), etc.

GET
/financial/ratios/{cvr}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/financial/ratios/37677892/ \
  --header 'Authorization: <session_token>'

Example response

[
  {
    "period": {
      "start": "2016-07-01",
      "end": "2017-12-31"
    },
    "cash_flow_ratio": -0.94,
    "leverage_ratio": -1.12,
    "asset_coverage": 0.6,
    "interest_coverage": null,
    "solidity_ratio": 0.4,
    "liquidity_ratio": 0.86,
    "return_on_investment": -0.5,
    "ffO_eq_ratio": -1.39,
    "ffO_eq_ratio_abs": 1.39,
    "current_assets_eq_ratio": 1,
    "return_on_eq": -0.98
  }
]

Financial stats

This endpoint has information about each financial report. We provide information about who audited the report, when it was approved, a link to the actual PDF report, whether they are IFRS (International Financial Reporting Standards) compliant, etc.

GET
/financial/stats/{cvr}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/financial/stats/37677892/ \
  --header 'Authorization: <session_token>'

Example response

[
  {
    "type": "årsrapport",
    "period": {
      "start": "2016-07-01",
      "end": "2017-12-31"
    },
    "supplementary_information": null,
    "approval_date": "2018-05-25",
    "general_meeting_date": "2018-05-25",
    "currency": "DKK",
    "ifrs": false,
    "company_size": null,
    "auditor": {
      "name": null,
      "type": "ingen bistand",
      "company_id": null,
      "company_name": null
    },
    "pdf_link": null
  }
]

Highlights

This endpoint provides some highlights that we have selected by analyzing the company, the data in the financial report and the people associated with the company. A highlight can be classified as either positive, neutral or negative. We provide a message for each highlight to explain what it means for the given situation.

GET
/highlights/{cvr}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/highlights/37677892/ \
  --header 'Authorization: <session_token>'

Example response

{
  "highlights": {
    "age": {
      "message": "",
      "description": null,
      "classification": "negative"
    },
    "change_in_address": {
      "message": "Virksomheden har skiftet adresse mere end 3 gange i løbet af året.",
      "description": null,
      "classification": "negative"
    },
    "change_in_management": {
      "message": "Virksomheden har haft ændringer i ledelsen 3 eller flere gange sidste år.",
      "description": null,
      "classification": "neutral"
    },
    "connected_bankruptcies": {
      "message": "Vi har undersøgt, om der har været konkurser i blandt de personer der har relationer til virksomheden og vi har ikke fundet noget.",
      "description": null,
      "classification": "neutral"
    },
    "intangible_assets": {
      "message": "Stor andel immaterielle anlægsaktiver - over 50% af egenkapitalen i selskabet består af immaterielle anlægsaktiver, hvilket kan betyde en øget finansiel risiko.",
      "description": null,
      "classification": "negative"
    },
    "one_financial_statement": {
      "message": "Virksomheden har kun ét regnskab, hvilket kan give usikkerhed i beregningen.",
      "description": null,
      "classification": "neutral"
    },
    "roi": {
      "message": null,
      "description": null,
      "classification": "negative"
    },
    "timely_delivery": {
      "message": "Virksomheden har aflagt regnskab rettidigt.",
      "description": null,
      "classification": "neutral"
    }
  }
}

Rating

These endpoints are essentially a way to sum up the entire company. We provide a number to represent how risky the company is (Risika score), and a credit recomendation.

Grades

GET
/rating/grades/{cvr}

Credit

GET
/rating/credit/{cvr}

Grades (Risika score)

This endpoint provides a grade (Risika score) for a given period.

We calculate the grade for each financial report available. This way, you will both have their current gade but also the historic grade, and will be able to see the development of their grade over time.

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/rating/grades/37677892/ \
  --header 'Authorization: <session_token>'

Example response

[
  {
    "period": {
      "start": "2016-07-01",
      "end": "2017-12-31"
    },
      "grade": 2
    }
]

Credit

This endpoint provides a credit recomendation for the company you requested. We provide you a credit max, credit days and an upfront payment recomendation.

The credit max does not depend on the credit you provide. We do, however, use the specified credit to calculate the max amount of days you should provide the credit.

We also provide an upfront payment amount. If the credit you provided is greater than the credit max, we will recommend that you request the remaining payment upfront.

GET
/rating/credit/{cvr}?credit={amount}

Example request

curl --request GET \
  --url https://api.risika.dk/v1_1/rating/credit/37677892?credit=10000 \
  --header 'Authorization: <session_token>'

Example response

{
  "upfront": 8000,
  "credit_days": 7,
  "credit_max": 2000
}

We provide two endpoints for searching – the first searches for companies, the second for people.

Company

GET
/search/company?query={company_name}&mode={mode}

Person (NOT AVAILABLE YET)

GET
/search/person?query={person_name}&mode={mode}

Search company

This endpoint enables you to search for companies by name instead of providing a CVR number. We return very basic information about the company as a response: CVR number and company name.

You can search with two different modes: minimal or full.

Minimal
Limitted to 25 search results. The results are also much simpler, containing only the name, CVR number and country code.

Full
There is no limit in the traditional sense, you use two additional parameters – to and from – which works as a way to paginate through the results. They default to a range of 0 – 100 if the to and from parameters aren't specified.

The results from the full mode also contains the Risika Score, company type, employee count and whether it is active.

GET
/search/company?query={company_name}&mode={mode}

Example request (minimal)

curl --request GET \
  --url https://api.risika.dk/v1_1/search/company?query=risika&mode=minimal \
  --header 'Authorization: <session_token>'

Example response (minimal)

{
  "search_result": [
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "37677892"
      },
      "company_name": "RISIKA ApS"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "39276208"
      },
      "company_name": "Risika Group ApS"
    }
  ],
  "count": null
}

Example request (full)

curl --request GET \
  --url https://api.risika.dk/v1_1/search/company?query=risika&mode=full&from=100&to=200 \
  --header 'Authorization: <session_token>'

Example response (full)

{
  "search_result": [
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "24207609"
      },
      "active": true,
      "company_name": "GC RIEBER COMPACT A/S",
      "score": 8,
      "short_description": "A/S",
      "employees_interval": "1-1"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "27761402"
      },
      "active": true,
      "company_name": "RIKKE LIND FINANS ApS",
      "score": 7,
      "short_description": "APS",
      "employees_interval": "ANTAL_2_4"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "38881248"
      },
      "active": true,
      "company_name": "Risskov Brynet VI K/S",
      "score": 1,
      "short_description": "K/S",
      "employees_interval": null
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "33746326"
      },
      "active": true,
      "company_name": "MC EJENDOMME RISSKOV ApS",
      "score": 5,
      "short_description": "APS",
      "employees_interval": "ANTAL_1_1"
    },
    {
      "organization_id": null,
      "local_organization_id": {
        "country": "DK",
        "id": "53371914"
      },
      "active": true,
      "company_name": "Ri, Statsautoriseret Revisionsaktieselskab",
      "score": 7,
      "short_description": "A/S",
      "employees_interval": "50-99"
    },
    ...
  ],
  "rows": {
    "from": 100,
    "to": 200
  },
  "count": null
}

Errors you might encounter

Out in the wild, there are countless errors you might encounter when you utilize the API. This section aims to provide you with information to help prevent them, and what might be causing the errors to help you fix them faster and make debugging easier.

Authorization

The authorization can fail in different ways, and each situation is different. We provide you with the necessary information to help solve the issue. The errors you might encounter are the following:

Missing authorization header
This happens when you haven't provided the Authorization header or when no authorization token has been provided.

Signature verification failed
This happens when the authorization token you provided was invalid.

Signature has expired
This will most likely happen when the session token you provided was generated more than 10 minutes ago, and you will need to request a new one.

When the authorization header has not been specified

{ "error": "Missing Authorization Header" }

When the token provided was invalid

{ "error": "Signature verification failed" }

When the token has expired

{ "error": "Signature has expired" }

Endpoint

Unknown resource
This happens if the endpoint you provided doesn't exist.

When the endpoint doesn't exist

{ "error": "Unknown resource" }

CVR-number

Invalid CVR-number
The format of the CVR-number is not correct e.g. if didn't contain exactly 8 digits, it contained letters or other illegal characters.

No company with the CVR-number
We provide this error when the format was correct, but we didn't find a company associated with the CVR-number you provided.

When the number you provided isn't a CVR-number

{ "error": "Invalid CVR-number" }

When the CVR-number is not associated with a company

{ "error": "No company with the CVR-number 37677893" }

Credit

Credit must be greater than 0
We cannot do any calculations based on a credit of '0'. If you don't know the credit amount, leave out the credit parameter alltogether, and we'll provide you with a standard calculatation.

Value not recognized as a number
We weren't able to parse the amount of credit you specified. Make sure to leave out thousand separators and decimals.

The credit was zero

{ "error": "Credit must be greater than 0" }

The credit provided couldn't be parsed as a number

{ "error": "Value not recognized as a number" }
Show examples in:
Risika API Documentation