Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.datasources.list()
for datasource in response.datasources:
print(f"{datasource.name} ({datasource.id}): {datasource.last_sync_status}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const response = await client.datasources.list();
for (const datasource of response.datasources) {
console.log(`${datasource.name} (${datasource.id}) - ${datasource.last_sync_status}`);
}package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Datasources.List(context.Background())
if err != nil {
panic(err)
}
for _, ds := range resp.Datasources {
fmt.Printf("%s - %s (last sync: %v)\n", ds.ID, ds.Name, ds.LastSyncStatus)
}
}curl --request GET \
--url https://api.meibel.ai/v2/datasources \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/datasources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.meibel.ai/v2/datasources")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"datasources": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"connector": {
"cloud_storage": {},
"web_crawl": {
"base_url": "<string>",
"javascript_render": false,
"domains": [
{
"domain": "<string>",
"include_pattern": "<string>",
"exclude_pattern": ""
}
]
}
},
"created_at": "<string>",
"updated_at": "<string>",
"last_sync_at": "<string>",
"last_sync_status": "<string>",
"total_ingested_files": 123,
"metadata_config": {
"fields": [
{
"name": "<string>",
"description": "<string>",
"index": true
}
],
"model_id": "<string>"
},
"files": {
"total": 123,
"deleted": 123
},
"ingest_counts": {
"rag": {
"total": 123,
"new": 123,
"updated": 123
},
"tag": {
"total": 123,
"new": 123,
"updated": 123
},
"ref_graph": {
"total": 123,
"new": 123,
"updated": 123
}
},
"tables": [
{
"name": "<string>",
"column_count": 123,
"description": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Datasources
List Datasources
GET
/
datasources
Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.datasources.list()
for datasource in response.datasources:
print(f"{datasource.name} ({datasource.id}): {datasource.last_sync_status}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const response = await client.datasources.list();
for (const datasource of response.datasources) {
console.log(`${datasource.name} (${datasource.id}) - ${datasource.last_sync_status}`);
}package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Datasources.List(context.Background())
if err != nil {
panic(err)
}
for _, ds := range resp.Datasources {
fmt.Printf("%s - %s (last sync: %v)\n", ds.ID, ds.Name, ds.LastSyncStatus)
}
}curl --request GET \
--url https://api.meibel.ai/v2/datasources \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/datasources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.meibel.ai/v2/datasources")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"datasources": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"connector": {
"cloud_storage": {},
"web_crawl": {
"base_url": "<string>",
"javascript_render": false,
"domains": [
{
"domain": "<string>",
"include_pattern": "<string>",
"exclude_pattern": ""
}
]
}
},
"created_at": "<string>",
"updated_at": "<string>",
"last_sync_at": "<string>",
"last_sync_status": "<string>",
"total_ingested_files": 123,
"metadata_config": {
"fields": [
{
"name": "<string>",
"description": "<string>",
"index": true
}
],
"model_id": "<string>"
},
"files": {
"total": 123,
"deleted": 123
},
"ingest_counts": {
"rag": {
"total": 123,
"new": 123,
"updated": 123
},
"tag": {
"total": 123,
"new": 123,
"updated": 123
},
"ref_graph": {
"total": 123,
"new": 123,
"updated": 123
}
},
"tables": [
{
"name": "<string>",
"column_count": 123,
"description": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?
⌘I