Data API / DataForSEO / On Page
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.
Параметры
Параметров пути, запроса и заголовков нет.
Тело запроса
idstringОбязательныйID of the task required field you can get this ID in the response of the Task POST endpoint example: “07131248-1535-0216-1000-17384017ad04”
keyword_lengthintegerОбязательныйnumber of words for a keyword required field possible values: 1, 2, 3, 4, 5
urlstringНеобязательный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 (including http:// or https://)
limitintegerНеобязательныйthe maximum number of returned keywords optional field default value: 100 maximum value: 1000
filtersarrayНеобязательныйarray of results filtering parameters optional field you can add several filters at once (8 filters maximum) you should set a logical operator and, or between the conditions the following operators are supported: regex, not_regex, =, , in, not_in, like, not_like you can use the % operator with like and not_like to match any string of zero or more characters example: ["keyword","=","%seo%"] [["keyword","=","%seo%"], "and", ["frequency"," [["keyword","not_like","%seo%"], "and", [["frequency",">","6"],"or",["density",">","0.02"]]] The full list of possible filters is available by this link.
order_bystring[]Необязательныйresults sorting rules optional field you can use the same values as in the filters array to sort the results possible sorting types: asc – results will be sorted in the ascending order desc – 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"]
tagstringНеобязательный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 specified tag value in the data object of the response
Пример запроса
curl -X POST "https://openapi.felo.ai/v1/beta/dataforseo/on_page/keyword_density" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "<string>",
"keyword_length": 0,
"url": "<string>",
"limit": 0,
"filters": "<string>",
"order_by": [
"<string>"
],
"tag": "<string>"
}'Ответ
Поля ответа
versionstringНеобязательныйthe current version of the API
status_codeintegerНеобязательныйgeneral status code you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
status_messagestringНеобязательныйgeneral informational message you can find the full list of general informational messages here
timestringНеобязательныйexecution time, seconds
costnumberНеобязательныйtotal tasks cost, USD
tasks_countintegerНеобязательныйthe number of tasks in the tasks array
tasks_errorintegerНеобязательныйthe number of tasks in the tasks array returned with an error
tasksstring[]Необязательныйarray of tasks
idstringНеобязательныйtask identifier unique task identifier in our system in the UUID format
status_codeintegerНеобязательный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
status_messagestringНеобязательныйinformational message of the task you can find the full list of general informational messages here
timestringНеобязательныйexecution time, seconds
costnumberНеобязательныйcost of the task, USD
result_countintegerНеобязательныйnumber of elements in the result array
pathstring[]НеобязательныйURL path
dataobjectНеобязательныйcontains the same parameters that you specified in the POST request
resultstring[]Необязательныйarray of results
crawl_progressstringНеобязательныйstatus of the crawling session possible values: in_progress, finished
crawl_statusobjectНеобязательныйdetails of the crawling session
max_crawl_pagesintegerНеобязательныйmaximum number of pages to crawl indicates the max_crawl_pages limit you specified when setting a task
pages_in_queueintegerНеобязательныйnumber of pages that are currently in the crawling queue
pages_crawledintegerНеобязательныйnumber of crawled pages
total_items_countintegerНеобязательныйtotal number of relevant items total number of keywords on the specified website or web page matching the set keyword_length and filters
items_countintegerНеобязательныйnumber of items in the results array
itemsstring[]Необязательныйitems array
keywordstringНеобязательныйreturned keyword
frequencyintegerНеобязательныйkeyword frequency number of times the keyword appears on the website (or webpage if you specified a url)
densityintegerНеобязательныйkeyword density calculated as a ratio of frequency to the total count of keywords with the set keyword_length on the web page or website