DataForSEO
SEO, search-engine results, keyword research, backlinks and AI visibility data.
Keyword Density
Word and phrase frequency across a crawl, with keyword_length choosing n-gram size. Returns total_items_count, items_count and items. Reads a finished crawl, so it needs the id from post_dataforseo_on_page_submit and returns crawl_progress plus a crawl_status of max_crawl_pages, pages_in_queue and pages_crawled - check those before trusting a small result, because a crawl still running simply has less to report. This describes what a site says about itself; for what the web says about it use post_dataforseo_backlinks_anchors_live, and for what people search use post_dataforseo_keywords_gads_search_volume_live. 💰 Free upstream: querying a finished crawl costs nothing, only the crawl itself does.
Pricing reference
- Metering: Reported response cost.
- Reference request estimate: USD 0.012.
- Reference customer multiplier: 1.0. Do not apply it again to a settled customer amount.
Reference metadata only, not an account quote, a guaranteed price or a spending cap. Resource credits are not Felo credits. Final charges follow Felo billing records.
- Type: array (object | null)[]
- filtersType: array (object | null)[] | null
array of results filtering parameters
optional field
you can add several filters at once (8 filters maximum)
you should set a logical operatorand,orbetween the conditions
the following operators are supported:regex,not_regex,=,<>,in,not_in,like,not_like
you can use the%operator withlikeandnot_liketo match any string of zero or more characters
example:["keyword","=","%seo%"][["keyword","=","%seo%"],
"and",
["frequency","<","6"]][["keyword","not_like","%seo%"],
"and",
[["frequency",">","6"],"or",["density",">","0.02"]]]The full list of possible filters is available by this link.
Empty object - idType: string
- keywordType: integer
_length number of words for a keyword
required field
possible values:1,2,3,4,5 - limitType: integer | null
the maximum number of returned keywords
optional field
default value:100
maximum value:1000 - orderType: array string[] | null
_by results sorting rules
optional field
you can use the same values as in thefiltersarray to sort the results
possible sorting types:asc- results will be sorted in the ascending orderdesc- results will be sorted in the descending order
you should use a comma to set up a sorting type
example:["frequency,desc"]
note that you can set no more than three sorting rules in a single request
you should use a comma to separate several sorting rules
example:["keyword,asc","frequency,desc"] - tagType: string | null
user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specifiedtagvalue in thedataobject of the response - urlType: string | null
page URL
optional field
if you do not specify a page here, the results will be provided for the whole website
if you use this field, the API response will contain only keywords from the specified page
a page should be specified with absolute URL (includinghttp://orhttps://)
- Type: object | null · Response36Afe1097B20_OnPageKeywordDensityResponseInfo200
- Type: number | null Format: doublecost
total tasks cost, USD
- Type: integer | nullstatus
_code general status code you can find the full list of the response codes here
- Type: string | nullstatus
_message general informational message you can find the full list of general informational messages here
- Type: array (object | null)[] | nulltasks
array of tasks
- Type: object | null · Response36Afe1097B20_OnPageKeywordDensityTaskInfo
- costType: number | null Format: double
total tasks cost, USD
- dataType: object | null
contains the same parameters that you specified in the POST request
- propertyType: object | null
Name
- idType: string | null
task identifier unique task identifier in our system in the UUID format
- pathType: array (string | null)[] | null
URL path
- resultType: array (object | null)[] | null
array of results
- crawlType: string | null
_progress status of the crawling session
possible values:in_progress,finished - crawlType: object | null · Response36Afe1097B20_CrawlStatusInfo
_status details of the crawling session
- maxType: integer | null Format: int64
_crawl _pages maximum number of pages to crawl indicates the max_crawl_pages limit you specified when setting a task
- pagesType: integer | null Format: int64
_crawled number of crawled pages
- pagesType: integer | null Format: int64
_in _queue number of pages that are currently in the crawling queue
- itemsType: array (object | null)[] | null
items array
- densityType: number | null
keyword density
calculated as a ratio offrequencyto the total count of keywords with the setkeyword_lengthon the web page or website - frequencyType: integer | null
keyword frequency
number of times the keyword appears on the website (or webpage if you specified aurl) - keywordType: string | null
returned keyword
- itemsType: integer | null Format: int64
_count number of items in the results array
- totalType: integer | null Format: int64
_items _count total number of relevant items
total number of keywords on the specified website or web page matching the setkeyword_lengthandfilters
- resultType: integer | null Format: int64
_count number of elements in the result array
- statusType: integer | null
_code status code of the task generated by DataForSEO, can be within the following range: 10000-60000 you can find the full list of the response codes here
- statusType: string | null
_message informational message of the task you can find the full list of general informational messages here
- timeType: string | null
execution time, seconds
- Type: integer | null Format: int64tasks
_count the number of tasks in the tasks array
- Type: integer | null Format: int64tasks
_error the number of tasks in the tasks array returned with an error
- Type: string | nulltime
total execution time, seconds
- Type: string | nullversion
the current version of the API
application/json - 400
The request could not be processed. Check the request parameters.
- 401
A valid Felo API key is required.
- 402
The request cannot proceed because a billing requirement is not met.
- 403
The account is not permitted to perform this operation.
- 429
A request or spending limit has been reached.
- 502
The service could not complete the request.
- 503
The API or billing service is temporarily unavailable.
- 504
The service timed out while processing the request.
- default
Error response; upstream passthrough responses may use provider formats
application/json
curl https://openapi.felo.ai/v1/beta/dataforseo/on_page/keyword_density \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '[
{
"id": "09101923-1535-0216-0000-2389a8854b70",
"url": "https://dataforseo.com/",
"keyword_length": 2,
"filters": [
"frequency",
">",
5
]
}
]'
{
"version": null,
"status_code": null,
"status_message": null,
"time": null,
"cost": null,
"tasks_count": null,
"tasks_error": null,
"tasks": [
{
"id": null,
"status_code": null,
"status_message": null,
"time": null,
"cost": null,
"result_count": null,
"path": [
null
],
"data": null,
"result": [
{
"crawl_progress": null,
"crawl_status": {
"max_crawl_pages": null,
"pages_in_queue": null,
"pages_crawled": null
},
"total_items_count": null,
"items_count": null,
"items": [
{
"keyword": null,
"frequency": null,
"density": null
}
]
}
]
}
]
}