import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const results = await api.discover.searchPosts({ q: "web3 publishing" })[
{
"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>"
}
}
]Search for posts across all publications. Returns results ranked by relevance, popularity, and recency.
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const results = await api.discover.searchPosts({ q: "web3 publishing" })[
{
"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>"
}
}
]Search query string
Optional publication ID to restrict search to a specific publication