Python
import os
from meibel import MeibelClient
from meibel.models import DataElementSearchRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
datasource_id = "ds_9f8a7b6c5d4e"
search_request = DataElementSearchRequest(
regex_filter=r"^invoice_.*",
media_type_filters=["application/pdf", "text/csv"],
)
response = client.datasources.data_elements.search(datasource_id, search_request)
for element in response.items:
print(f"{element.id}: {element.name} ({element.media_type})")
print(f"has_next={response.has_next}, next_cursor={response.next_cursor}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const results = await client.datasources.dataElements.search(
"ds_8f3a1c2b9e",
{
regex_filter: "^invoice_.*\\.pdf$",
media_type_filters: ["application/pdf"],
}
);
for (const element of results.items) {
console.log(`${element.name} (${element.media_type})`);
}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.DataElements.Search(
context.Background(),
"ds_9f8a1c2b3d4e",
v2.DataElementSearchRequest{
RegexFilter: v2.String("^invoice_.*"),
MediaTypeFilters: []string{"application/pdf", "image/png"},
},
)
if err != nil {
panic(err)
}
for _, item := range resp.Items {
fmt.Printf("%s: %s\n", item.ID, item.Name)
}
}curl --request POST \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"regex_filter": "<string>",
"media_type_filters": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({regex_filter: '<string>', media_type_filters: ['<string>']})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search', 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/{datasource_id}/data-elements/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'regex_filter' => '<string>',
'media_type_filters' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.post("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"regex_filter\": \"<string>\",\n \"media_type_filters\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"regex_filter\": \"<string>\",\n \"media_type_filters\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"datasource_id": "<string>",
"name": "<string>",
"description": "<string>",
"media_type": "<string>",
"metadata": {},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"next_cursor": "<string>",
"has_next": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Data elements
Search Data Elements
POST
/
datasources
/
{datasource_id}
/
data-elements
/
search
Python
import os
from meibel import MeibelClient
from meibel.models import DataElementSearchRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
datasource_id = "ds_9f8a7b6c5d4e"
search_request = DataElementSearchRequest(
regex_filter=r"^invoice_.*",
media_type_filters=["application/pdf", "text/csv"],
)
response = client.datasources.data_elements.search(datasource_id, search_request)
for element in response.items:
print(f"{element.id}: {element.name} ({element.media_type})")
print(f"has_next={response.has_next}, next_cursor={response.next_cursor}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const results = await client.datasources.dataElements.search(
"ds_8f3a1c2b9e",
{
regex_filter: "^invoice_.*\\.pdf$",
media_type_filters: ["application/pdf"],
}
);
for (const element of results.items) {
console.log(`${element.name} (${element.media_type})`);
}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.DataElements.Search(
context.Background(),
"ds_9f8a1c2b3d4e",
v2.DataElementSearchRequest{
RegexFilter: v2.String("^invoice_.*"),
MediaTypeFilters: []string{"application/pdf", "image/png"},
},
)
if err != nil {
panic(err)
}
for _, item := range resp.Items {
fmt.Printf("%s: %s\n", item.ID, item.Name)
}
}curl --request POST \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"regex_filter": "<string>",
"media_type_filters": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({regex_filter: '<string>', media_type_filters: ['<string>']})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search', 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/{datasource_id}/data-elements/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'regex_filter' => '<string>',
'media_type_filters' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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.post("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"regex_filter\": \"<string>\",\n \"media_type_filters\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/data-elements/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"regex_filter\": \"<string>\",\n \"media_type_filters\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "<string>",
"datasource_id": "<string>",
"name": "<string>",
"description": "<string>",
"media_type": "<string>",
"metadata": {},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"next_cursor": "<string>",
"has_next": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Query Parameters
Cursor for pagination
Maximum items to return
Required range:
1 <= x <= 1000Body
application/json
Response
Successful Response
Was this page helpful?
⌘I