Get yield campaigns
curl --request GET \
--url https://api.yield.xyz/v1/yields/{yieldId}/campaigns \
--header 'x-api-key: <api-key>'import requests
url = "https://api.yield.xyz/v1/yields/{yieldId}/campaigns"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.yield.xyz/v1/yields/{yieldId}/campaigns', 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.yield.xyz/v1/yields/{yieldId}/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.yield.xyz/v1/yields/{yieldId}/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.yield.xyz/v1/yields/{yieldId}/campaigns")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/yields/{yieldId}/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 100,
"offset": 0,
"limit": 20,
"items": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"yieldId": "<string>",
"status": "draft",
"rewardMode": "normal",
"rewardRate": {
"total": 6.5,
"rateType": "APR",
"components": [
{
"rate": 0.04,
"rateType": "APR",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"yieldSource": "protocol_incentive",
"description": "LDO distributed to incentivize stETH adoption via Lido Boost"
}
]
},
"totalBudget": "<string>",
"distributedBudget": "<string>",
"remainingBudget": "<string>",
"qualificationConfig": {
"type": "min_token_amount",
"threshold": "100",
"maxIncentivizedTvlToken": "1000000"
},
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"payoutFrequency": "weekly",
"rewardToken": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"name": "<string>",
"configuredHourlyEmission": "<string>",
"apyCeiling": 0.125,
"lastProcessedHour": "2023-11-07T05:31:56Z",
"nextPayoutDueAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400
}{
"message": "Invalid API key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"statusCode": 429,
"retryAfter": 30
}{
"message": "Internal server error",
"error": "Internal Server Error",
"statusCode": 500
}Yields
List yield campaigns
List the incentive campaigns attached to a yield within your project’s scope.
GET
/
v1
/
yields
/
{yieldId}
/
campaigns
Get yield campaigns
curl --request GET \
--url https://api.yield.xyz/v1/yields/{yieldId}/campaigns \
--header 'x-api-key: <api-key>'import requests
url = "https://api.yield.xyz/v1/yields/{yieldId}/campaigns"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.yield.xyz/v1/yields/{yieldId}/campaigns', 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.yield.xyz/v1/yields/{yieldId}/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.yield.xyz/v1/yields/{yieldId}/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.yield.xyz/v1/yields/{yieldId}/campaigns")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/yields/{yieldId}/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 100,
"offset": 0,
"limit": 20,
"items": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"yieldId": "<string>",
"status": "draft",
"rewardMode": "normal",
"rewardRate": {
"total": 6.5,
"rateType": "APR",
"components": [
{
"rate": 0.04,
"rateType": "APR",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"yieldSource": "protocol_incentive",
"description": "LDO distributed to incentivize stETH adoption via Lido Boost"
}
]
},
"totalBudget": "<string>",
"distributedBudget": "<string>",
"remainingBudget": "<string>",
"qualificationConfig": {
"type": "min_token_amount",
"threshold": "100",
"maxIncentivizedTvlToken": "1000000"
},
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"payoutFrequency": "weekly",
"rewardToken": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"name": "<string>",
"configuredHourlyEmission": "<string>",
"apyCeiling": 0.125,
"lastProcessedHour": "2023-11-07T05:31:56Z",
"nextPayoutDueAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400
}{
"message": "Invalid API key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"statusCode": 429,
"retryAfter": 30
}{
"message": "Internal server error",
"error": "Internal Server Error",
"statusCode": 500
}status filters by campaign status (active, paused, ended; draft is rejected with 400) and defaults to active. Pagination is offset (default 0) and limit (default 20, max 100).
A campaign’s rate also appears inside the yield’s reward rate as a campaign_incentive component. See Incentive campaigns and Reward rate.Authorizations
Path Parameters
Yield integration ID.
Example:
"cosmos-atom-native-staking"
Query Parameters
Offset for pagination
Required range:
x >= 0Example:
0
Maximum number of items to return
Required range:
1 <= x <= 100Example:
20
Campaign status filter. Defaults to active.
Available options:
active, paused, ended ⌘I

