Sentometrics BV is een data-as-a-service B2B bedrijf. Al onze data producten en functionaliteiten zijn beschikbaar via een REST API, conform de OpenAPI 3.0 specificatie. De ruggengraat van ons platform is een serverless computing architectuur die gebruikmaakt van een event-driven model, waardoor we flexibel en op aanvraag kunnen opschalen. Contacteer ons voor meer informatie over de integratie van onze API in uw business analytics pijplijnen.
Ter illustratie bieden we een publieke API aan die momenteel deze website ondersteunt. Bekijk onze API's en hun documentatie:
We verwelkomen het gebruik van onze indices door onderzoekers. De integratie van de Sentometrics indices in uw applicatie is nog nooit zo eenvoudig geweest. Hieronder vindt u twee voorbeeldscripts om een index op te halen in R en Python.
Stap 1: Beschikbare indices ophalen via de API
De lijst van publiek beschikbare indices is toegankelijk via het /index eindpunt. Elke thematische index heeft verschillende varianten.
# 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
# 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
Stap 2: Selecteer een index uit de lijst
Indices worden gekenmerkt door drie variabelen: naam (thema), frequentie en bron. Een combinatie hiervan identificeert een unieke index.
## 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
## 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
Stap 3: Historische data ophalen
Een index wordt ook geïdentificeerd door een uniek id. Gebruik het id in andere API eindpunten om de informatie van de index op te halen. Het /index/{id}/values eindpunt maakt het mogelijk om historische data op te halen.
## 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
## 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]
Stap 4: Gebruik onze data in uw applicatie
Onze data is gestandaardiseerd en klaar voor gebruik. Gebruik het gerust in uw onderzoek! Hier is een voorbeeld van het visualiseren van de index.
# Visualizing the index plot(idx_values[order(timestamp)], type = "l")

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