[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"help:\u002Fhelp\u002Fapi-keys-and-first-request":3},{"id":4,"title":5,"body":6,"category":553,"description":554,"extension":555,"meta":556,"navigation":557,"order":558,"path":559,"seo":560,"stem":561,"__hash__":562},"help\u002Fhelp\u002Fapi-keys-and-first-request.md","API keys and your first API request",{"type":7,"value":8,"toc":542},"minimark",[9,13,18,30,41,44,48,51,61,72,76,79,188,199,218,225,229,250,293,300,304,310,314,375,378,382,415,419,445,539],[10,11,12],"p",{},"Everything you can do in the dashboard's search tools is also available over a REST API at the same prices. This article covers keys and the basic flow. The full list of routes and fields is in the API reference at api.dataatscale.com\u002Fdocs.",[14,15,17],"h2",{"id":16},"create-a-key","Create a key",[10,19,20,21,25,26,29],{},"Only admins can create keys. Open ",[22,23,24],"strong",{},"Settings › Developers",", press ",[22,27,28],{},"New key",", and give it a name that says what it is for, because the name is the only label you see later. The full key is shown once, so copy it then. You can never see it again.",[10,31,32,33,37,38,40],{},"A key starts with ",[34,35,36],"code",{},"das_live_",", belongs to your organisation, and never expires. When you create it you can pick one workspace, and the key then works only in that workspace. Revoke a key in ",[22,39,24],{}," and it stops working immediately. When the person who made a key changes or resets their password, the keys they made are revoked too, so make new ones then.",[10,42,43],{},"A key can run searches, read tasks and results, and check your balance, tokens, limits, usage and credit history. A key limited to a workspace cannot read the credit history. Changing your plan, buying credits, opening the payment portal and inviting people stay with an admin signed in to the dashboard.",[14,45,47],{"id":46},"send-the-key","Send the key",[10,49,50],{},"Each request carries one header:",[52,53,58],"pre",{"className":54,"code":56,"language":57},[55],"language-text","Authorization: Bearer das_live_your_key\n","text",[34,59,56],{"__ignoreMap":60},"",[10,62,63,64,67,68,71],{},"Requests also need to accept gzip, so send ",[34,65,66],{},"Accept-Encoding: gzip",". A request without it is refused with ",[34,69,70],{},"gzip_required",".",[14,73,75],{"id":74},"submit-a-search","Submit a search",[10,77,78],{},"Each tool has its own route, and the same routes are listed in the API reference.",[80,81,82,95],"table",{},[83,84,85],"thead",{},[86,87,88,92],"tr",{},[89,90,91],"th",{},"Tool",[89,93,94],{},"Route",[96,97,98,116,132,148,164,174],"tbody",{},[86,99,100,104],{},[101,102,103],"td",{},"Find similar",[101,105,106,109,110,109,113],{},[34,107,108],{},"POST \u002Fv1\u002Fyoutube\u002Flookalike",", ",[34,111,112],{},"\u002Fv1\u002Ftiktok\u002Flookalike",[34,114,115],{},"\u002Fv1\u002Finstagram\u002Flookalike",[86,117,118,121],{},[101,119,120],{},"Search by topic",[101,122,123,109,126,109,129],{},[34,124,125],{},"POST \u002Fv1\u002Fyoutube\u002Ftopic-search",[34,127,128],{},"\u002Fv1\u002Ftiktok\u002Ftopic-search",[34,130,131],{},"\u002Fv1\u002Finstagram\u002Ftopic-search",[86,133,134,137],{},[101,135,136],{},"Look up creators",[101,138,139,109,142,109,145],{},[34,140,141],{},"POST \u002Fv1\u002Fyoutube\u002Fcreator-lookup",[34,143,144],{},"\u002Fv1\u002Ftiktok\u002Fcreator-lookup",[34,146,147],{},"\u002Fv1\u002Finstagram\u002Fcreator-lookup",[86,149,150,153],{},[101,151,152],{},"Creator Brand Scan",[101,154,155,109,158,109,161],{},[34,156,157],{},"POST \u002Fv1\u002Fyoutube\u002Fbrand-scan",[34,159,160],{},"\u002Fv1\u002Ftiktok\u002Fbrand-scan",[34,162,163],{},"\u002Fv1\u002Finstagram\u002Fbrand-scan",[86,165,166,169],{},[101,167,168],{},"YouTube channel emails",[101,170,171],{},[34,172,173],{},"POST \u002Fv1\u002Fyoutube\u002Femail-extraction",[86,175,176,179],{},[101,177,178],{},"TikTok Shop",[101,180,181,184,185],{},[34,182,183],{},"POST \u002Fv1\u002Ftiktok\u002Fshop\u002Fcreator-search"," and the other four under ",[34,186,187],{},"\u002Fv1\u002Ftiktok\u002Fshop\u002F",[10,189,190,191,194,195,198],{},"Name the task with an optional ",[34,192,193],{},"label"," of 1 to 120 characters. Without one it gets a generated name. Send ",[34,196,197],{},"workspace_id"," to run it in a workspace, and leave it out to use your default workspace.",[10,200,201,202,205,206,209,210,213,214,217],{},"The response gives you a ",[34,203,204],{},"task_id"," and ",[34,207,208],{},"credits_locked",", which is the most the task can cost, and ",[34,211,212],{},"tokens_locked",", the tokens it holds. Send ",[34,215,216],{},"max_credits"," to set the most you are willing to pay: if the task would cost more, nothing is started or charged and the request is refused. A malformed request is refused with a 422 that lists the fields that failed, and a field name the API does not know is refused and not ignored.",[10,219,220,221,224],{},"To see the price before you commit, send the same body to the tool's route plus ",[34,222,223],{},"\u002Festimate",". Estimates, input checks and match counts are free.",[14,226,228],{"id":227},"get-the-results","Get the results",[10,230,231,232,235,236,239,240,109,243,246,247,71],{},"Searches run in the background and take a few minutes, up to about 40 minutes. A task is ",[34,233,234],{},"queued",", then ",[34,237,238],{},"running",", then ends as ",[34,241,242],{},"completed",[34,244,245],{},"failed"," or ",[34,248,249],{},"cancelled",[251,252,253,272,278],"ol",{},[254,255,256,257,260,261,264,265,109,267,246,269,271],"li",{},"Poll ",[34,258,259],{},"GET \u002Fv1\u002F{platform}\u002F{feature}\u002F{task_id}"," until ",[34,262,263],{},"status"," is ",[34,266,242],{},[34,268,245],{},[34,270,249],{},". The call returns at once with the current state, so you can call it as often as you like.",[254,273,274,275,71],{},"Read ",[34,276,277],{},"GET \u002Fv1\u002F{platform}\u002F{feature}\u002F{task_id}\u002Fresults",[254,279,280,281,284,285,288,289,292],{},"Each page carries ",[34,282,283],{},"next_cursor",". Send it back as ",[34,286,287],{},"?cursor="," for the next page and stop when it comes back empty. Do not build or parse a cursor yourself. ",[34,290,291],{},"limit"," sets the page size.",[10,294,295,296,299],{},"Instead of polling you can pass a ",[34,297,298],{},"webhook_url"," at submit, which the next article covers.",[14,301,303],{"id":302},"cancel-a-task","Cancel a task",[10,305,306,309],{},[34,307,308],{},"POST \u002Fv1\u002F{platform}\u002F{feature}\u002F{task_id}\u002Fcancel"," stops a task that has not ended. Results already produced are charged at the normal rate, and the rest of the held credits and tokens come back.",[14,311,313],{"id":312},"size-limits-for-one-task","Size limits for one task",[80,315,316,326],{},[83,317,318],{},[86,319,320,323],{},[89,321,322],{},"Task",[89,324,325],{},"Most it takes",[96,327,328,336,344,352,360,368],{},[86,329,330,333],{},[101,331,332],{},"Find similar, Search by topic",[101,334,335],{},"1,000 results",[86,337,338,341],{},[101,339,340],{},"TikTok Shop affiliate search",[101,342,343],{},"20,000 creators",[86,345,346,349],{},[101,347,348],{},"Look up channels, creators or accounts",[101,350,351],{},"5,000 creators",[86,353,354,357],{},[101,355,356],{},"Look up GMV",[101,358,359],{},"10,000 creators",[86,361,362,365],{},[101,363,364],{},"Get channel emails",[101,366,367],{},"1,000 channels",[86,369,370,372],{},[101,371,152],{},[101,373,374],{},"1 creator",[10,376,377],{},"A request body can be at most 256 KB, and a larger one is refused with a 413. Saving creators to a list and bulk list changes take larger bodies.",[14,379,381],{"id":380},"prices-balance-and-limits","Prices, balance and limits",[383,384,385,391,397,403,409],"ul",{},[254,386,387,390],{},[34,388,389],{},"GET \u002Fv1\u002Fpricing"," returns the live credit price of each tool and what a credit costs you.",[254,392,393,396],{},[34,394,395],{},"GET \u002Fv1\u002Fbilling\u002Fbalance"," returns your balance.",[254,398,399,402],{},[34,400,401],{},"GET \u002Fv1\u002Fbilling\u002Ftokens"," returns the tokens you hold and when each batch ends.",[254,404,405,408],{},[34,406,407],{},"GET \u002Fv1\u002Fbilling\u002Flimits"," shows each daily limit and how much is used.",[254,410,411,414],{},[34,412,413],{},"GET \u002Fv1\u002Fbilling\u002Fledger"," lists all credit movements.",[14,416,418],{"id":417},"errors","Errors",[10,420,421,422,424,425,428,429,432,433,436,437,440,441,444],{},"Each error has a ",[34,423,34],{}," you can branch on and a ",[34,426,427],{},"detail"," sentence for a person. A 422 adds ",[34,430,431],{},"fields",", and a 402 adds ",[34,434,435],{},"credits_needed"," and your ",[34,438,439],{},"balance",", or ",[34,442,443],{},"cap_remaining"," when your monthly spending cap stopped it. A 429 for too many requests adds how many seconds until more open up.",[80,446,447,457],{},[83,448,449],{},[86,450,451,454],{},[89,452,453],{},"Code",[89,455,456],{},"Meaning",[96,458,459,469,479,489,499,509,519,529],{},[86,460,461,466],{},[101,462,463],{},[34,464,465],{},"unauthorized",[101,467,468],{},"Your key is missing, invalid or revoked.",[86,470,471,476],{},[101,472,473],{},[34,474,475],{},"insufficient_credits",[101,477,478],{},"Your balance cannot cover what the request can cost.",[86,480,481,486],{},[101,482,483],{},[34,484,485],{},"spending_cap_reached",[101,487,488],{},"The request would take this month past your spending cap.",[86,490,491,496],{},[101,492,493],{},[34,494,495],{},"forbidden",[101,497,498],{},"Your role or workspace access does not allow it.",[86,500,501,506],{},[101,502,503],{},[34,504,505],{},"email_not_confirmed",[101,507,508],{},"The account behind the key has not confirmed its email.",[86,510,511,516],{},[101,512,513],{},[34,514,515],{},"daily_limit_reached",[101,517,518],{},"A daily limit of your plan is used up.",[86,520,521,526],{},[101,522,523],{},[34,524,525],{},"rate_limited",[101,527,528],{},"Too many requests to one route in 10 minutes.",[86,530,531,536],{},[101,532,533],{},[34,534,535],{},"validation_error",[101,537,538],{},"A field is missing or not in the expected format.",[10,540,541],{},"New codes may appear, so handle an unknown one by its HTTP status.",{"title":60,"searchDepth":543,"depth":543,"links":544},2,[545,546,547,548,549,550,551,552],{"id":16,"depth":543,"text":17},{"id":46,"depth":543,"text":47},{"id":74,"depth":543,"text":75},{"id":227,"depth":543,"text":228},{"id":302,"depth":543,"text":303},{"id":312,"depth":543,"text":313},{"id":380,"depth":543,"text":381},{"id":417,"depth":543,"text":418},"API and AI assistants","Create an API key, send it in the Authorization header, submit a search, poll for the results and read them page by page.","md",{},true,14,"\u002Fhelp\u002Fapi-keys-and-first-request",{"title":5,"description":554},"help\u002Fapi-keys-and-first-request","jZXvNjfrPejIUhWcH2CSVxNDrC6ukLjxSRtft66IiT0"]