Get posts by tag with pagination
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const { items, pagination } = await api.posts.get({ tag: "crypto", limit: 20 })curl --request GET \
--url https://public.api.paragraph.com/api/v1/posts/tag/{tag}import requests
url = "https://public.api.paragraph.com/api/v1/posts/tag/{tag}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public.api.paragraph.com/api/v1/posts/tag/{tag}', 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/posts/tag/{tag}",
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/posts/tag/{tag}"
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/posts/tag/{tag}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/posts/tag/{tag}")
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{
"items": [
{
"id": "<string>",
"title": "<string>",
"slug": "<string>",
"imageUrl": "<string>",
"publishedAt": "<string>",
"updatedAt": "<string>",
"subtitle": "<string>",
"staticHtml": "<string>",
"json": "<string>",
"markdown": "<string>",
"coinId": "<string>",
"categories": [
"<string>"
],
"authors": [
{
"id": "<string>",
"publicationId": "<string>",
"walletAddress": "<string>",
"avatarUrl": "<string>",
"name": "<string>",
"bio": "<string>",
"farcaster": {
"username": "<string>",
"displayName": "<string>",
"fid": 123
}
}
],
"authorIds": [
"<string>"
],
"views": 123
}
],
"pagination": {
"hasMore": true,
"cursor": "<string>",
"total": 123
}
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}posts
Get posts by tag
Retrieve a paginated list of posts with a specific tag, sorted by publish date (newest first)
GET
/
v1
/
posts
/
tag
/
{tag}
Get posts by tag with pagination
import { ParagraphAPI } from "@paragraph-com/sdk"
const api = new ParagraphAPI()
const { items, pagination } = await api.posts.get({ tag: "crypto", limit: 20 })curl --request GET \
--url https://public.api.paragraph.com/api/v1/posts/tag/{tag}import requests
url = "https://public.api.paragraph.com/api/v1/posts/tag/{tag}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://public.api.paragraph.com/api/v1/posts/tag/{tag}', 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/posts/tag/{tag}",
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/posts/tag/{tag}"
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/posts/tag/{tag}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.paragraph.com/api/v1/posts/tag/{tag}")
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{
"items": [
{
"id": "<string>",
"title": "<string>",
"slug": "<string>",
"imageUrl": "<string>",
"publishedAt": "<string>",
"updatedAt": "<string>",
"subtitle": "<string>",
"staticHtml": "<string>",
"json": "<string>",
"markdown": "<string>",
"coinId": "<string>",
"categories": [
"<string>"
],
"authors": [
{
"id": "<string>",
"publicationId": "<string>",
"walletAddress": "<string>",
"avatarUrl": "<string>",
"name": "<string>",
"bio": "<string>",
"farcaster": {
"username": "<string>",
"displayName": "<string>",
"fid": 123
}
}
],
"authorIds": [
"<string>"
],
"views": 123
}
],
"pagination": {
"hasMore": true,
"cursor": "<string>",
"total": 123
}
}{
"success": false,
"msg": "<string>"
}{
"success": false,
"msg": "<string>"
}Path Parameters
Tag to filter posts by
Minimum string length:
1Query Parameters
Cursor for pagination
Maximum number of items to return (1-100, default: 10)
Required range:
1 <= x <= 100Include full content fields (json, staticHtml, markdown) in the post. Default: false
⌘I

