Documentation / API / campaigns_saved_opportunities
campaigns_saved_opportunities
POSThttps://api.oppalerts.com/v1/campaigns/saved_opportunities
Lists the saved opportunities of one campaign and what each one searches.
What it does
The tool returns every saved opportunity of one campaign, with its id, label, state, and search settings. campaigns_dashboard returns the daily counts of the active saved opportunities. The ids are the values that news_opportunities and prospects_opportunities take. A number or a link minimum that is not set is not in filters, and a saved opportunity with no link minimum has no link_counts_min. An unset text field is empty.
Each saved opportunity also shows what it searches, using the field names of the change tool campaigns_saved_opportunity_add: search, opportunity_type, content_type, the numbers in filters, the link minimums as the object link_counts_min in filters, similarity_target, similarity_text, title_query, body_query, and title_body_join. campaign is required.
This tool only reads. campaigns_saved_opportunity_add and the other saved opportunity change tools change the saved opportunities.
Authentication
Send your token in the Authorization: Bearer header. The API overview explains how to get a token.
Parameters
campaignint, required, 1 to 4294967295- The campaign id, from campaigns_list. It must be a campaign of your account.
Strict Rules
- A field that is not in the list above is refused. The answer is HTTP 400 with the error code
bad_param. The error names the field: "<field> is not a field of this tool." The old name of a renamed field is refused in the same way. - A bad value is refused, and the error names the field. A bad value is a value of the wrong type, a number with a fraction for a whole-number field, a value out of its range, or a value that is not in its list. A required field that you do not send is refused too. The tool never changes a value that you send.
- An error about the format of a call, such as a refused field, names the field. Its message ends with one sentence: "Read the documentation at https://oppalerts.com/docs for the correct format." Every other error has only its own sentence.
Response fields
campaign_vector_readybooltruewhen the vector ofsimilarity_targetcampaignis made.opportunitieslist- One item for each saved opportunity.
opportunities[].idint- The id of the saved opportunity. news_opportunities and prospects_opportunities take it as
opportunity. opportunities[].labelstring- The name of the saved opportunity.
opportunities[].statestring- The state of the saved opportunity. The example shows
active. opportunities[].searchstring- What the saved opportunity finds:
no_type,opportunity_type,content_type, or one of the 6 brand searchesbrand_links,brand_mentions,unlinked_brand_mentions,brand_link_gap,competitor_links, andcompetitor_mentions. opportunities[].opportunity_typestring- The opportunity type as
<group>/<type>, forsearchopportunity_type. Empty for another search. opportunities[].content_typestring- The content type, for
searchcontent_type. Empty for another search. opportunities[].filtersobject- The numeric fields of the saved opportunity. A number that is not set is not in
filters. opportunities[].filters.type_score_minint, optional- The minimum type score, 0 to 100.
opportunities[].filters.similarity_score_minint, optional- The minimum similarity in percent, 1 to 100.
opportunities[].filters.pr_domain_minint, optional- The minimum domain PageRank, 0 to 100.
opportunities[].filters.pr_domain_maxint, optional- The maximum domain PageRank, 0 to 100.
opportunities[].filters.pr_host_minint, optional- The minimum host PageRank, 0 to 100.
opportunities[].filters.pr_host_maxint, optional- The maximum host PageRank, 0 to 100.
opportunities[].filters.prot_domain_minint, optional- The minimum domain PRoT (PageRank over Time), 0 to 1000000.
opportunities[].filters.prot_domain_maxint, optional- The maximum domain PRoT, 0 to 1000000.
opportunities[].filters.prot_host_minint, optional- The minimum host PRoT, 0 to 1000000.
opportunities[].filters.prot_host_maxint, optional- The maximum host PRoT, 0 to 1000000.
opportunities[].filters.link_counts_min.articleobject, optional- The minimum number of outbound links in the article section of a page, for each link type:
follow,nofollow,sponsored, andugc. A saved opportunity with no link minimum has nolink_counts_min. opportunities[].filters.link_counts_min.navobject, optional- The same, for the navigation section of a page.
opportunities[].filters.link_counts_min.commentsobject, optional- The same, for the comments section of a page.
opportunities[].similarity_targetstring- What the pages must be semantically similar to:
none,campaign, orsimilarity_text. Empty when it is not set. opportunities[].similarity_textstring- The text of
similarity_targetsimilarity_text. Empty when it is not set. opportunities[].vector_readybooltruewhen the vector of thesimilarity_textof the saved opportunity is made.opportunities[].title_querystring- The words the title must have. Empty when it is not set.
opportunities[].body_querystring- The words the body must have. Empty when it is not set.
opportunities[].title_body_joinstring- How
title_queryandbody_queryare combined:andoror. Empty when it is not set.
Example
Request
curl -X POST https://api.oppalerts.com/v1/campaigns/saved_opportunities \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"campaign": 3}'
Response
The response is shown in full.
{
"campaign_vector_ready": true,
"opportunities": [
{
"id": 12,
"label": "Media kits naming boutique hotels",
"state": "active",
"search": "opportunity_type",
"opportunity_type": "advertising/advertise-with-us",
"content_type": "",
"filters": {
"type_score_min": 40,
"similarity_score_min": 25,
"pr_domain_min": 20,
"pr_domain_max": 80,
"pr_host_min": 10,
"pr_host_max": 90,
"prot_domain_min": 5,
"prot_domain_max": 95,
"prot_host_min": 5,
"prot_host_max": 95,
"link_counts_min": {
"article": {
"follow": 2,
"nofollow": 1,
"sponsored": 0,
"ugc": 0
},
"nav": {
"follow": 1,
"nofollow": 0,
"sponsored": 0,
"ugc": 0
},
"comments": {
"follow": 0,
"nofollow": 1,
"sponsored": 0,
"ugc": 0
}
}
},
"similarity_target": "campaign",
"similarity_text": "",
"vector_ready": false,
"title_query": "\"media kit\" OR advertise",
"body_query": "",
"title_body_join": ""
}
]
}
Errors
bad_param(HTTP 400): a field is not a field of this tool, a required field is not sent, or a value has the wrong type or is out of its range. The error names the field.no_campaign(HTTP 404): the campaign is not in this accountdb_error(HTTP 500): the data could not be readdaily_limit(HTTP 429): the account has used all its calls for this tool today. account_calls_left shows when the count resets.
This tool has its own daily count. A call through the API or MCP uses one call from this count. A web app page reading the same data does not count. It is not an index search, so it does not use the shared count of the news_ and prospects_ tools, and the error one_at_a_time does not apply to it.
Same tool in MCP
The MCP tool is campaigns_saved_opportunities. See campaigns_saved_opportunities in MCP.