API

Sentometrics BV ist ein B2B-Unternehmen, das Daten als Service anbietet. Alle unsere Datenprodukte und Funktionen sind über eine REST-API verfügbar, die der OpenAPI 3.0-Spezifikation entspricht. Basis bildet eine serverlose Computing-Plattform mit ereignisgesteuertem Modell, die es uns ermöglicht, flexibel zu skalieren. Kontaktieren Sie uns, um zu erfahren, wie Sie unsere API in Ihre Business-Analytics-Pipelines integrieren können.

Als Beispiel stellen wir derzeit eine öffentliche API bereit, die diese Website unterstützt. Entdecken Sie unsere APIs und deren Dokumentation:

Wir freuen uns, wenn Sie unsere Indizes in Ihren Analysen nutzen. Die Integration der Sentometrics-Indizes in Ihre Anwendung war noch nie so einfach. Unten finden Sie zwei Beispielskripte, um einen Index mit R oder Python abzurufen.

TIMO-API-Beispielskript
  • Schritt 1: Verfügbare Indizes von der API abrufen

    Die Liste der öffentlich verfügbaren Indizes befindet sich hinter dem /index-Endpunkt. Jeder thematische Index besitzt mehrere Variationen.

    R
    # Load required libraries library(httr) library(data.table) # Retrieve list of indices from the API list_indices <- httr::GET( "https://api.sentometrics.com/public/timo/index" ) list_indices <- httr::content(list_indices) list_indices <- data.table::rbindlist(list_indices, fill=TRUE) head(list_indices, 3) #> id name friendly_name #> <int> <char> <char> #> 1: 2909 Unemployment_D_BE_NL Unemployment Attention Indicator #> 2: 2907 R_M_BE Recession Attention Indicator #> 3: 2908 Unemployment_D_BE_FR Unemployment Attention Indicator #> friendly_frequency source #> <char> <char> #> 1: Daily Belgium - Dutch #> 2: Monthly Belgium #> 3: Daily Belgium - French
    Python
    # Load required libraries import requests import pandas as pd # Retrieve list of indices from the API list_indices = requests.get( "https://api.sentometrics.com/public/timo/index" ) list_indices = pd.DataFrame(list_indices.json()) print(list_indices.head()) #> id name friendly_name \ #> 0 9290 Inflation_M_BE_FR Inflation Attention Indicator #> 1 9331 R_D_BE_NL Recession Attention Indicator #> 2 293628 Aging_M_BE_NL Aging Attention Indicator #> 3 303512 Climate_M_BE_FR Climate Attention Indicator #> 4 303513 Climate_M_BE_NL Climate Attention Indicator #> #> friendly_frequency source #> 0 Monthly Belgium - French #> 1 Daily Belgium - Dutch #> 2 Monthly Belgium - Dutch #> 3 Monthly Belgium - French #> 4 Monthly Belgium - Dutch
  • Schritt 2: Einen Index aus der Liste auswählen

    Indizes werden durch drei Variablen charakterisiert: Name (Thema), Frequenz und Quelle. Eine Kombination dieser identifiziert einen einzelnen Index.

    R
    ## Select the economic sentiment index idx <- list_indices[ list_indices$friendly_name == "Economic Sentiment Indicator" & list_indices$friendly_frequency == "Daily" & list_indices$source == "Belgium" ] idx #> id name friendly_name friendly_frequency #> <int> <char> <char> <char> #> 1: 2894 ECOS_D_BE Economic Sentiment Indicator Daily #> source #> <char> #> 1: Belgium
    Python
    ## Select the economic sentiment index idx = list_indices[ (list_indices["friendly_name"] == "Economic Sentiment Indicator") & (list_indices["friendly_frequency"] == "Daily") & (list_indices["source"] == "Belgium") ] print(idx) #> id name friendly_name friendly_frequency source #> 5 9320 ECOS_D_BE Economic Sentiment Indicator Daily Belgium
  • Schritt 3: Historische Daten abrufen

    Ein Index wird auch durch eine eindeutige ID identifiziert. Verwenden Sie die ID in anderen API-Endpunkten, um die Details des Index abzurufen. Der /index/{id}/values-Endpunkt ermöglicht das Abrufen historischer Daten.

    R
    ## Retrieve historical values idx_values <- httr::GET( sprintf( "https://api.sentometrics.com/public/timo/index/%i/values?from_date=%s", idx$id, # index's ID "2000-01-01" # starting date of the series ) ) idx_values <- httr::content(idx_values) idx_values <- data.table::rbindlist(idx_values) idx_values$timestamp <- as.POSIXct(idx_values$timestamp) idx_values #> timestamp value #> <POSc> <num> #> 1: 2000-01-01 0.4092101 #> 2: 2000-01-02 0.3981897 #> 3: 2000-01-03 0.4078824 #> 4: 2000-01-04 0.3746895 #> 5: 2000-01-05 0.3250847 #> --- #> 9254: 2025-05-02 -0.2618843 #> 9255: 2025-05-03 -0.2747073 #> 9256: 2025-05-04 -0.2727378 #> 9257: 2025-05-05 -0.3317673 #> 9258: 2025-05-06 -0.2838641
    Python
    ## Retrieve historical values idx_values = requests.get( "https://api.sentometrics.com/public/timo/index/{id}/values?from_date={from_date}".format( id=idx["id"].item(), # index's ID from_date="2000-01-01" # starting date of the series ) ) idx_values = pd.DataFrame(idx_values.json()) idx_values["timestamp"] = pd.to_datetime(idx_values["timestamp"]) print(idx_values) #> timestamp value #> 0 2000-01-01 00:00:00+00:00 0.409210 #> 1 2000-01-02 00:00:00+00:00 0.398190 #> 2 2000-01-03 00:00:00+00:00 0.407882 #> 3 2000-01-04 00:00:00+00:00 0.374689 #> 4 2000-01-05 00:00:00+00:00 0.325085 #> ... ... ... #> 9253 2025-05-02 00:00:00+00:00 -0.261884 #> 9254 2025-05-03 00:00:00+00:00 -0.274707 #> 9255 2025-05-04 00:00:00+00:00 -0.272738 #> 9256 2025-05-05 00:00:00+00:00 -0.331767 #> 9257 2025-05-06 00:00:00+00:00 -0.283864 #> #> [9258 rows x 2 columns]
  • Schritt 4: Unsere Daten in Ihrer Anwendung nutzen

    Unsere Daten sind standardisiert und einsatzbereit. Verwenden Sie sie gerne in Ihrer Analyse! Hier ist ein kurzes Beispiel zur Visualisierung des Index.

    R
    # Visualizing the index plot(idx_values[order(timestamp)], type = "l")

    Python
    # Visualizing the index import matplotlib.pyplot as plt idx_values.set_index("timestamp").plot() #> <AxesSubplot:xlabel='timestamp'> plt.show()