Skip to main content

Projects API

The Projects API provides a suite of endpoints to manage your projects, briefs, and keywords. All endpoints are available under the /v1/projects path.

Authentication

All requests to the Projects API must be authenticated using a Bearer token in the Authorization header.

Authorization: Bearer <YOUR_API_KEY>

The Project Object

A project object represents a project in your account. It contains not only basic information but also detailed brand intelligence and competitor data.

AttributeTypeDescription
project_idintegerThe unique identifier for the project.
created_atstringThe date and time the project was created.
main_urlstringThe main URL associated with the project.
project_namestringThe name of the project.
updated_atstringThe date and time the project was last updated.
statusstringThe current status of the project (e.g., active).
brand_intelligenceobjectAn object containing detailed brand information. See below.
competitorsarrayA list of competitor URLs.

The Brand Intelligence Object

This object provides deep insights into the project's brand, audience, and market positioning.

AttributeTypeDescription
user_declared_audiencestringThe audience as described by the user.
audience_pain_pointsarrayA list of pain points experienced by the target audience.
benefitsarrayA list of benefits your product/service offers.
featuresarrayA list of key product/service features.
short_product_descriptionstringA concise description of the product or service.
yahini_generated_audiencearrayA list of audience segments identified by Yahini.
user_declared_topicsstringTopics of interest as declared by the user.
use_casesarrayA list of common use cases for the product/service.

The Brief Object

A brief object contains the generated content brief for a specific keyword.

AttributeTypeDescription
briefstringThe full content of the generated brief.
created_atstringThe date and time the brief was created.
meta_descriptionstringA suggested meta description for the content.
meta_titlestringA suggested meta title for the content.
primary_keywordstringThe primary keyword the brief is based on.
wordcountstringThe suggested word count range for the content.
keyword_idintegerThe ID of the keyword associated with this brief.

The Keyword Object

A keyword object represents a single keyword within a project.

AttributeTypeDescription
archivedbooleanWhether the keyword is archived.
briefbooleanWhether a brief has been generated for this keyword.
competition_levelintegerThe competitive level of the keyword.
created_atstringThe date and time the keyword was added.
funnel_stagestringThe marketing funnel stage (e.g., BOFU).
is_generating_briefbooleanWhether a brief is currently being generated.
keyword_difficultyintegerThe keyword difficulty score.
keyword_idintegerThe unique identifier for the keyword.
keyword_tagstringAny tags associated with the keyword.
primary_keywordstringThe keyword phrase.
priorityintegerThe priority level of the keyword.
search_volumeintegerThe estimated monthly search volume.
secondary_keywordsarrayA list of related secondary keywords.
selectedbooleanWhether the keyword is selected.
updated_atstringThe date and time the keyword was last updated.
user_generatedbooleanWhether the keyword was added by a user.
working_titlestringA working title for content based on this keyword.

Project Endpoints

List All Projects

Retrieves a list of all projects associated with your account.

GET /v1/projects

Example Request

curl "https://api.yahini.io/v1/projects" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Get a Single Project

Retrieves a single project by its ID. This provides a detailed view of the project, including its brand intelligence.

GET /v1/projects/:projectId

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project to retrieve.

Example Request

curl "https://api.yahini.io/v1/projects/374" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Brief Endpoints

List All Briefs for a Project

Retrieves a list of all generated briefs for a specific project. You can use query parameters to paginate the results.

GET /v1/projects/:projectId/briefs

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.

Query Parameters

ParameterTypeDescription
limitintegerThe maximum number of briefs to return. Defaults to all.

Example Request

curl "https://api.yahini.io/v1/projects/374/briefs" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Get a Single Brief

Retrieves a single brief by its associated keyword ID.

GET /v1/projects/:projectId/briefs/:keywordId

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.
keywordIdstringRequired. The ID of the keyword associated with the brief.

Example Request

curl "https://api.yahini.io/v1/projects/374/briefs/36543" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Generate Briefs

Generates briefs for one or more keywords in a project. This is an asynchronous operation. The API will accept the request and start processing in the background.

POST /v1/projects/:projectId/briefs

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.

Body Parameters

ParameterTypeDescription
keywordsarrayRequired. An array of keyword IDs to generate briefs for.
enhance_brief_instructionsstringOptional. If a brief for a specified keyword already exists, you must provide instructions here to regenerate it. This prevents accidental overwrites and ensures that regeneration is intentional. This parameter is only considered when regenerating a single brief.

Example Request

curl -X POST "https://api.yahini.io/v1/projects/374/briefs" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"keywords": [36543, 36684]
}'

Keyword Endpoints

List All Keywords for a Project

Retrieves a list of all keywords for a specific project. You can use query parameters to filter, sort, and paginate the results.

GET /v1/projects/:projectId/keywords

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.

Query Parameters

ParameterTypeDescription
limitintegerThe maximum number of keywords to return.
sort_bystringThe field to sort the keywords by (e.g., search_volume).
orderstringThe order to sort in (asc or desc).
[any]anyYou can filter by any attribute of the keyword object (e.g., funnel_stage=BOFU).

Example Request

curl "https://api.yahini.io/v1/projects/374/keywords?limit=10&sort_by=priority&order=desc" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Get a Single Keyword

Retrieves a single keyword by its ID.

GET /v1/projects/:projectId/keywords/:keywordId

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.
keywordIdstringRequired. The ID of the keyword.

Example Request

curl "https://api.yahini.io/v1/projects/374/keywords/15131" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Import Keywords

Imports a list of new keywords into a project. This is an asynchronous operation. The API will accept the request and start processing in the background.

POST /v1/projects/:projectId/keywords

Path Parameters

ParameterTypeDescription
projectIdstringRequired. The ID of the project.

Body Parameters

The body must be an object containing a keywords property, which is an array of keyword objects. You can import up to 200 keywords at a time.

Each keyword object in the keywords array can have the following attributes:

AttributeTypeRequiredDescription
primary_keywordstringYesThe main keyword phrase.
search_volumeintegerYesThe estimated monthly search volume. Must be a non-negative number.
secondary_keywordsarrayNoAn array of related secondary keywords (strings). Up to 10 are allowed.
keyword_difficultyintegerNoThe keyword difficulty score.
priorityintegerNoThe priority of the keyword, from 1 (lowest) to 4 (highest).
funnel_stagestringNoThe marketing funnel stage. Must be one of TOFU, MOFU, or BOFU.

Example Request

curl -X POST "https://api.yahini.io/v1/projects/374/keywords" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"keywords": [
{
"primary_keyword": "Hono",
"search_volume": 12000,
"funnel_stage": "BOFU",
"priority": 4
},
{
"primary_keyword": "Cloudflare Workers",
"search_volume": 25000,
"secondary_keywords": ["cloudflare", "serverless"],
"keyword_difficulty": 65
}
]
}'