Search posts
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const results = await api.discover.searchPosts({ q: "web3 publishing" })curl "https://public.api.paragraph.com/api/v1/discover/search?q=web3+publishing"import requests
url = "https://public.api.paragraph.com/api/v1/discover/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public.api.paragraph.com/api/v1/discover/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://public.api.paragraph.com/api/v1/discover/search",
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/discover/search"
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/discover/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/discover/search")
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[
{
"post": {
"postId": "<string>",
"blogId": "<string>",
"createdAt": "<string>",
"publishedAt": "<string>",
"title": "<string>",
"subtitle": "<string>",
"postPreview": "<string>",
"coverImageUrl": "<string>",
"slug": "<string>",
"coinId": "<string>"
},
"blog": {
"blogId": "<string>",
"userId": "<string>",
"name": "<string>",
"url": "<string>",
"slug": "<string>",
"logoUrl": "<string>",
"coinId": "<string>",
"customDomain": "<string>",
"summary": "<string>"
},
"user": {
"userId": "<string>",
"name": "<string>",
"bio": "<string>",
"avatarUrl": "<string>",
"walletAddress": "<string>"
}
}
]{
"success": false,
"msg": "<string>"
}discover
Search posts
Search for posts across all publications. Returns results ranked by relevance, popularity, and recency.
GET
/
v1
/
discover
/
search
Search posts
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const results = await api.discover.searchPosts({ q: "web3 publishing" })curl "https://public.api.paragraph.com/api/v1/discover/search?q=web3+publishing"import requests
url = "https://public.api.paragraph.com/api/v1/discover/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public.api.paragraph.com/api/v1/discover/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://public.api.paragraph.com/api/v1/discover/search",
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/discover/search"
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/discover/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/discover/search")
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[
{
"post": {
"postId": "<string>",
"blogId": "<string>",
"createdAt": "<string>",
"publishedAt": "<string>",
"title": "<string>",
"subtitle": "<string>",
"postPreview": "<string>",
"coverImageUrl": "<string>",
"slug": "<string>",
"coinId": "<string>"
},
"blog": {
"blogId": "<string>",
"userId": "<string>",
"name": "<string>",
"url": "<string>",
"slug": "<string>",
"logoUrl": "<string>",
"coinId": "<string>",
"customDomain": "<string>",
"summary": "<string>"
},
"user": {
"userId": "<string>",
"name": "<string>",
"bio": "<string>",
"avatarUrl": "<string>",
"walletAddress": "<string>"
}
}
]{
"success": false,
"msg": "<string>"
}Query Parameters
Search query string
Optional publication ID to restrict search to a specific publication
⌘I

