🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)
🕵️ SicherheitslückenUSN-8747-1: Beets vulnerability(10.09.2026 um 17:56 Uhr)
🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)
🕵️ SicherheitslückenUSN-8747-1: Beets vulnerability(10.09.2026 um 17:56 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 5 Min Lesezeit
0

How to Build a Custom Looker Studio Connector

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Google Looker Studio is a powerful platform for creating interactive dashboards. However, sometimes you need to fetch data from external APIs or other data sources that are not supported by default. This is where custom connectors come in. In this guide, we’ll walk you through building a connector to fetch external data, using Bitcoin prices as an example.

All the code for this project will be written and edited in the ) and makes it available in Looker Studio. The process involves defining configuration options, schema, data fetching logic, and minimal authentication.





1. Defining Configuration Parameters



To allow users to customize the behavior of the connector, such as providing an API key or setting the number of days of data to fetch, we define a configuration using getConfig.




CODE
function getConfig(request) {
var config = cc.getConfig();

config.newTextInput()
.setId('apiKeyInput')
.setName('API Key:')
.setHelpText('cryptocompare.com API key')
.setPlaceholder('YOUR-API-KEY');

config.newTextInput()
.setId('dayLimit')
.setName('Number of Days')
.setHelpText('Number of days to fetch Bitcoin price data')
.setPlaceholder('30');

return config.build();
}






Here, two fields are defined:




  • apiKeyInput: To enter the API key for authenticating with the external API.

  • dayLimit: To specify the number of days of historical data to fetch.






2. Defining the Data Schema



The schema determines the fields (columns) in the data returned by the connector.




CODE
function getSchema(request) {
var schema = [
{ name: 'time', label: 'Time', dataType: 'NUMBER' },
{ name: 'close', label: 'Close Price', dataType: 'NUMBER' }
];
return { schema: schema };
}








  • time: A numeric field representing timestamps.

  • close: A numeric field representing the closing price of Bitcoin.



This schema structure can be modified to fit the data you need from your API.






3. Fetching Data from an External API



The getData function is where the data is fetched from the API, transformed, and returned to Looker Studio.




CODE
function getData(request) {
var apiKey = request.configParams.apiKeyInput;
var dayLimit = request.configParams.dayLimit || '30';

if (!apiKey) {
throw new Error("API Key is missing. Please provide a valid API key.");
}

var url = "https://min-api.cryptocompare.com/data/v2/histoday?fsym=BTC&tsym=USD&limit=" + dayLimit + "&api_key=" + apiKey;

var response = UrlFetchApp.fetch(url);
var json = JSON.parse(response.getContentText());
var data = json.Data.Data;

var schema = [
{ name: 'time', label: 'Time', dataType: 'NUMBER' },
{ name: 'close', label: 'Close Price', dataType: 'NUMBER' }
];

var rows = data.map(function (item) {
return { values: [item.time, item.close] };
});

return { schema: schema, rows: rows };
}







The API URL dynamically incorporates the user-provided API key and the number of days (dayLimit).

The API response is parsed, and the relevant fields are extracted into rows.





4. Authentication and Admin Settings



This connector does not require authentication, but you must specify it explicitly. Additionally, the isAdminUser function is required by Looker Studio.




CODE
function getAuthType() {
return cc.newAuthTypeResponse()
.setAuthType(cc.AuthType.NONE)
.build();
}

function isAdminUser() {
return false;
}








  • getAuthType specifies that no authentication is required.

  • isAdminUser simply returns false since this connector does not need admin-specific features.






Full Code



Here is the complete code for the connector:




CODE
var cc = DataStudioApp.createCommunityConnector();

function getConfig(request) {
var config = cc.getConfig();

config.newTextInput()
.setId('apiKeyInput')
.setName('API Key:')
.setHelpText('cryptocompare.com API key')
.setPlaceholder('YOUR-API-KEY');

config.newTextInput()
.setId('dayLimit')
.setName('Number of Days')
.setHelpText('Number of days to fetch Bitcoin price data')
.setPlaceholder('30');

return config.build();
}

function getSchema(request) {
var schema = [
{ name: 'time', label: 'Time', dataType: 'NUMBER' },
{ name: 'close', label: 'Close Price', dataType: 'NUMBER' }
];
return { schema: schema };
}

function getData(request) {
var apiKey = request.configParams.apiKeyInput;
var dayLimit = request.configParams.dayLimit || '30';

if (!apiKey) {
throw new Error("API Key is missing. Please provide a valid API key.");
}

var url = "https://min-api.cryptocompare.com/data/v2/histoday?fsym=BTC&tsym=USD&limit=" + dayLimit + "&api_key=" + apiKey;

var response = UrlFetchApp.fetch(url);
var json = JSON.parse(response.getContentText());
var data = json.Data.Data;

var schema = [
{ name: 'time', label: 'Time', dataType: 'NUMBER' },
{ name: 'close', label: 'Close Price', dataType: 'NUMBER' }
];

var rows = data.map(function (item) {
return { values: [item.time, item.close] };
});

return { schema: schema, rows: rows };
}

function getAuthType() {
return cc.newAuthTypeResponse()
.setAuthType(cc.AuthType.NONE)
.build();
}

function isAdminUser() {
return false;
}







appsscript.json sample:




CODE
{
"timeZone": "",
"dependencies": {
"libraries": []
},
"dataStudio": {
"name": "Bitcoin Historical Price",
"logoUrl": "https://cdn-icons-png.flaticon.com/512/825/825540.png",
"company": "Test Company",
"companyUrl": "https://example.com/",
"addonUrl": "https://example.com/",
"supportUrl": "https://example.com/",
"description": "Get bitcoin price using JSON and cryptocompare.com API"
},
"oauthScopes": [
"https://www.googleapis.com/auth/script.external_request"
],
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "MYSELF"
}
}









Deployment




  1. Save the above code in Google Apps Script.

  2. Deploy the connector by selecting Deploy > New Deployment.

  3. Select Web app Add-on, Click Deploy.

  4. Click on Looker Studio generated link.

  5. Test the connector in Looker Studio by configuring the API key and number of days.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
OpenAI Bans Russian ChatGPT Accounts Used in Covert Influence Campaign
1 Quelle
Fake GTA 6 Demo Spreads Malware: How to Spot the Scam
1 Quelle
CrowdStrike Disrupts Sality Botnet After More Than 20 Years
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Build a Custom Looker Studio Connector

Thematisch verwandte Begriffe: Build, Custom, Looker, Studio · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...