Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
client = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
u = client.get_user(uid)
# Search for events with specific tags
events = u.search_event_by_tags(tags=["emotion", "romance"])
# Search for events with specific tag values
events = u.search_event_by_tags(tag_values={"emotion": "happy", "topic": "work"})
# Combine both filters
events = u.search_event_by_tags(tags=["emotion"], tag_values={"topic": "work"})curl --request GET \
--url https://api.memobase.dev/api/v1/users/event_tags/search/{user_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}', 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.memobase.dev/api/v1/users/event_tags/search/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"events": [
{
"id": "<string>",
"event_data": {
"profile_delta": [
{
"content": "<string>",
"attributes": {}
}
],
"event_tip": "<string>",
"event_tags": [
{
"tag": "<string>",
"value": "<string>"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"similarity": 123
}
],
"gists": [
{
"id": "<string>",
"gist_data": {
"content": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"similarity": 123
}
]
},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}User Events
Search Events By Tags
GET
/
api
/
v1
/
users
/
event_tags
/
search
/
{user_id}
Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
client = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
u = client.get_user(uid)
# Search for events with specific tags
events = u.search_event_by_tags(tags=["emotion", "romance"])
# Search for events with specific tag values
events = u.search_event_by_tags(tag_values={"emotion": "happy", "topic": "work"})
# Combine both filters
events = u.search_event_by_tags(tags=["emotion"], tag_values={"topic": "work"})curl --request GET \
--url https://api.memobase.dev/api/v1/users/event_tags/search/{user_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}', 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.memobase.dev/api/v1/users/event_tags/search/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/users/event_tags/search/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"events": [
{
"id": "<string>",
"event_data": {
"profile_delta": [
{
"content": "<string>",
"attributes": {}
}
],
"event_tip": "<string>",
"event_tags": [
{
"tag": "<string>",
"value": "<string>"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"similarity": 123
}
],
"gists": [
{
"id": "<string>",
"gist_data": {
"content": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"similarity": 123
}
]
},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Search events by tags.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the user
Query Parameters
Comma-separated list of tag names that events must have (e.g.'emotion,romance')
Comma-separated tag=value pairs for exact matches (e.g., 'emotion=happy,topic=work')
Number of events to retrieve, default is 10
Response
Successful Response
⌘I