Get user by ID - Paragraph
Get user by ID
TypeScript
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const user = await api.users.get({ id: "AeAOtR8TqKWyzG5apA1R" }).single()
curl --request GET \
--url https://public.api.paragraph.com/api/v1/users/{userId}
import requests
url = "https://public.api.paragraph.com/api/v1/users/{userId}"
response = requests.get(url)
print(response.text)
const options = {method: 'GET'};
fetch('https://public.api.paragraph.com/api/v1/users/{userId}', 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://public.api.paragraph.com/api/v1/users/{userId}",\
CURLOPT_RETURNTRANSFER => true,\
CURLOPT_ENCODING => "",\
CURLOPT_MAXREDIRS => 10,\
CURLOPT_TIMEOUT => 30,\
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
CURLOPT_CUSTOMREQUEST => "GET",\
]);
$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://public.api.paragraph.com/api/v1/users/{userId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.get("https://public.api.paragraph.com/api/v1/users/{userId}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/users/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
Response Status Codes
Example JSON Response
{
"id": "<string>",
"publicationId": "<string>",
"walletAddress": "<string>",
"avatarUrl": "<string>",
"name": "<string>",
"bio": "<string>",
"farcaster": {
"username": "<string>",
"displayName": "<string>",
"fid": 123
}
}
Error Response
{
"success": false,
"msg": "<string>"
}
Path Parameters
- userId: string (required) - Unique identifier of the user
Response Fields
- id: string (required) - Unique identifier for the user
- publicationId: string (required) - ID of the publication this user belongs to
- walletAddress: string - Wallet address of the user (Pattern:
^0x[a-fA-F0-9]{40}$)
- avatarUrl: string - URL to the user's avatar image
- name: string - Display name of the user
- bio: string - Brief biography of the user (max 500 characters)
- farcaster: object - Farcaster profile information, if linked