PageSourceSearch

https://docs.audd.io/assets/js/f1a54ba7.dda76e84.js

js audd.io collected 2026-10-01 13:55:19 UTC 79,820 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkaudd_docs=globalThis.webpackChunkaudd_docs||[]).push([[164],{9696(e,t,n){n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>d,default:()=>m,frontMatter:()=>l,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"enterprise","title":"Enterprise endpoint","description":"This is a separate endpoint with enterprise features and the ability to handle large files. You can send hours- or even days-long audio to this endpoint and receive highly detailed metadata in response.","source":"@site/docs/enterprise.md","sourceDirName":".","slug":"/enterprise","permalink":"/enterprise","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"enterprise","slug":"/enterprise","title":"Enterprise endpoint","pagination_label":"Enterprise endpoint","sidebar_label":"Music recognition for larger audio and video files","hide_title":true,"keywords":["music recognition api","audd","dj","mixes","large audio files","video files","docs"],"image":"https://audd.tech/docs-enterprise.png"},"sidebar":"docs","previous":{"title":"Audio streams","permalink":"/streams"},"next":{"title":"Official AudD SDKs","permalink":"/sdks"}}');var r=n(4848),s=n(8453),i=(n(4865),n(8149),n(9365),n(8478),n(2170)),o=n(9142);const l={id:"enterprise",slug:"/enterprise",title:"Enterprise endpoint",pagination_label:"Enterprise endpoint",sidebar_label:"Music recognition for larger audio and video files",hide_title:!0,keywords:["music recognition api","audd","dj","mixes","large audio files","video files","docs"],image:"https://audd.tech/docs-enterprise.png"},d="API Docs for the enterprise endpoint",u={},c=[{value:"Where to get a token",id:"where-to-get-a-token",level:2},{value:"How to send files",id:"how-to-send-files",level:2},{value:'<HttpRequestTitle class="PostRequestWrapper"><code>POST</code></HttpRequestTitle> Send a file',id:"post-send-a-file",level:3},{value:"How to get additional metadata, e.g., ISRCs and UPCs",id:"how-to-get-additional-metadata-eg-isrcs-and-upcs",level:2}];function p(e){const t={a:"a",admonition:"admonition",code:"code",div:"div",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"api-docs-for-the-enterprise-endpoint",children:"API Docs for the enterprise endpoint"})}),"\n",(0,r.jsx)(i.d,{mdPath:"/enterprise.md"}),"\n",(0,r.jsx)(t.p,{children:"This is a separate endpoint with enterprise features and the ability to handle large files. You can send hours- or even days-long audio to this endpoint and receive highly detailed metadata in response."}),"\n",(0,r.jsxs)(t.p,{children:["To identify music from shorter audio clips and retreive rich metadata, including the detailed composition data Spotify, Apple Music, Musicbrainz and other hold (and not just links), use our ",(0,r.jsx)(t.a,{href:"/",children:"main API endpoint"}),". For industry-leading broadcast monitoring, see ",(0,r.jsx)(t.a,{href:"/streams",children:"Streams"}),"."]}),"\n",(0,r.jsxs)(t.p,{children:["The API is very easy to integrate directly; however, we maintain ",(0,r.jsx)(t.a,{href:"/sdks",children:"SDKs for 11 languages"}),"."]}),"\n",(0,r.jsxs)(t.admonition,{title:"How the requests are counted",type:"important",children:[(0,r.jsxs)(t.p,{children:["We count requests to the enterprise endpoint as ",(0,r.jsx)(t.strong,{children:"1 request per 12 seconds"})," of audio."]}),(0,r.jsxs)(t.p,{children:["When you upload a file, our servers consider it to be a group of 12-second-long audio chunks. If you don't want every one of these chunks to be recognized and counted as the requests, there are two parameters that you can use: ",(0,r.jsx)(t.code,{children:"skip"})," and ",(0,r.jsx)(t.code,{children:"every"}),"."]}),(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"skip"})," - the number of 12-second-long audio chunks to skip after the ones that are scanned;"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"every"})," -  the number of chunks to scan in a row."]}),"\n"]}),(0,r.jsxs)(t.p,{children:["So if you want to identify music playing in the first 12 seconds, then skip 48 seconds, then scan 12 seconds again, skip 48 seconds again, etc., these parameters should be skip=4 and every=1. If you want to skip 108 seconds, to have 1 request per 12
10 seconds of audio, send ",(0,r.jsx)(t.code,{children:"skip=9"})," and ",(0,r.jsx)(t.code,{children:"every=1"}),"."]})]}),"\n",(0,r.jsx)(t.h2,{id:"where-to-get-a-token",children:"Where to get a token"}),"\n",(0,r.jsxs)(t.p,{children:["You can get a token from our ",(0,r.jsx)(t.a,{href:"https://dashboard.audd.io/",children:"API Dashboard"}),"."]}),"\n",(0,r.jsx)(t.p,{children:"The first 300 requests are free; our subscription options start at $2 per 1000 requests. We use Stripe for secure payments; we can also accept US domestic and international bank transfers from enterprise customers."}),"\n",(0,r.jsx)(t.h2,{id:"how-to-send-files",children:"How to send files"}),"\n",(0,r.jsx)(t.p,{children:"There are two ways to send files to the API:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Provide a URL of the file. Our server will download and recognize music from the file. Send the URL in the ",(0,r.jsx)(t.code,{children:"url"})," parameter. (You can also send a URL of a web page that contains audio or video instead of the URL of the actual audio file)"]}),"\n",(0,r.jsxs)(t.li,{children:["Post the file using multipart/form-data in the ",(0,r.jsx)(t.a,{href:"https://stackoverflow.com/questions/8659808/how-does-http-file-upload-work",children:"usual way"})," the files are uploaded via the browser. Send the file in the ",(0,r.jsx)(t.code,{children:"file"})," parameter, by POST. This method is useful if the file is not available by a URL."]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["You can try to send a file from a browser ",(0,r.jsx)(t.a,{href:"https://audd.io/upload/?endpoint=enterprise",children:"here"})," (or ",(0,r.jsx)(t.a,{href:"https://audd.io/upload/?endpoint=enterprise&params=response_type=csv",children:"here"})," for csv results instead of json)."]}),"\n",(0,r.jsxs)("div",{class:"markdown request-section",children:[(0,r.jsxs)(t.h3,{id:"post-send-a-file",children:[(0,r.jsx)(o.WA,{color:"#26cb7c",type:"post",class:"PostRequestWrapper",children:(0,r.jsx)(t.code,{children:"POST"})})," Send a file"]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-text",children:"https://enterprise.audd.io/\n"})}),(0,r.jsx)(o.W5,{codeExamples:!0,endpoint:"https://enterprise.audd.io/",id:"entepriseExample",parameters:[{name:"api_token",type:"string",required:!0,description:"The token received from the Dashboard",example:"your api token"},{name:"url",type:"string",description:"The URL of the file for the recognition",example:"https://audd.tech/djatwork_example.mp3"},{name:"file",type:"binary",description:"The file for the recognition",example:"/path/to/largeFile.mp3"},{name:"accurate_offsets",type:"string",required:!1,description:'Set to "true" to get accurate start and end offsets of the recognized tracks',example:"true"},{name:"skip",type:"integer",required:!1,description:"How many 12 seconds chunks are skipped after the ones that are recognized",example:"3"},{name:"every",type:"integer",required:!1,description:"How many chunks should be recognized in a row",example:"1"},{name:"limit",type:"integer",required:!1,description:"The upper bound for the number of chunks the server will recognize"},{name:"skip_first_seconds",type:"integer",required:!1,description:"How many seconds of the file the server should skip at the beginning before starting the music recognition (e.g., the start time of the first chunk). Should not be used together with use_timecode"},{name:"use_timecode",type:"string",required:!1,description:'Set to "true" if you want the server to use the time represented in "t", "time_continue", or "start" parameters of the URL, if one exists, as the skip_first_seconds. Should not be used together with skip_first_seconds'}],exampleResponseDescription:(0,r.jsx)(t.div,{children:(0,r.jsxs)(t.p,{children:["Here's an example of a response you can get from the recognition of ",(0,r.jsx)(t.a,{href:"https://audd.tech/djatwork_example.mp3",children:"this hour-long mix"}),". It's a real response (shown here as its first three of 63 chunks), and we replaced the duplicate song results with '...' so it's a bit easier to scroll."]})}),exampleResponse:{status:"success",result:[{songs:[{score:100,artist:"Ali Angel",title:"Tou patou II",album:"Notre histoire",release_date:"2002-06-05",label:"BELIEVE - Pastel Productions",timecode:"00:11",isrc:"FR6V81099777",upc:"3760009882294",song_link:"https://lis.tn/TouPatouII",start_offset:1,end_offset:8680},{score:100,artist:"Future Shock",title:"Dance Floor",album:"Beyond Forever",release_date:"2020-03-20",label:"Sportn' Life Music Group",timecode:"00:11",isrc:"QM4TX2035991",upc:"194491888015",song_link:"https://lis.tn/uxRpGN",start_offset:1,end_offset:8840},{score:100,artist:"Anthony Acosta",title:"The Way She Moves",album:"The Way She Moves",release_date:"2008-06-01",label:"2254767 Records DK",timecode:"00:33",isrc:"QZHN32178577",upc:"196164729410",song_link:"https://lis.tn/HgiZkK",start_offset:1,end_offset:7820}],offset:"00:00"},{songs:[{score:100,artist:"Barely Alive",title:"Keyboard Killer",album:"Lost in the Internet EP",release_date:"2014-03-10",label:"Disciple Recordings",timecode:"00:41",isrc:"FR4GL1069639",upc:"3610154900148",song_link:"https://lis.tn/KeyboardKiller",start_offset:1,end_offset:9660}],offset:"00:48"},{songs:[{score:100,artist:"Barely Alive",title:"Keyboard Killer",album:"Lost in the Internet EP",release_date:"2014-03-10",label:"Disciple Recordings",timecode:"01:31",isrc:"FR4GL1069639",upc:"3610154900148",song_link:"https://lis.tn/KeyboardKiller",start_offset:1,end_offset:8440}],offset:"01:36"}],execution_time:"38.335355495s"}})]}),"\n",(0,r.jsxs)(t.admonition,{title:"Fields referring to time",type:"info",children:[(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"timecode"})," is the position ",(0,r.jsx)(t.strong,{children:"in the original song"})," where the matched fragment is playing (e.g., that can be 00:45 of Imagine Dragons - Warriors)."]}),(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"offset"})," is the position, in the audio file you submitted, of the start of the 12-second-long fragment that contains matches."]}),(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"start_offset"})," and ",(0,r.jsx)(t.code,{children:"end_offset"})," are the positions (in milliseconds) ",(0,r.jsx)(t.strong,{children:"in the 12-second-long fragment"})," of the start and end of the fragment we matched to a song."]})]}),"\n",(0,r.jsx)(t.h2,{id:"how-to-get-additional-metadata-eg-isrcs-and-upcs",children:"How to get additional metadata, e.g., ISRCs and UPCs"}),"\n",(0,r.jsxs)(t.p,{children:["You don't have to have an enterprise account in order to use the enterprise endpoint. But you need an enterprise account to get ISRCs and UPCs with the results. Let us know if you want access to these features: send an email to ",(0,r.jsx)(t.a,{href:"mailto:[email protected]",children:"[email protected]"}),"."]}),"\n",(0,r.jsx)(i.e,{})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}}
1,9365(e,t,n){n.d(t,{A:()=>l});n(6540);var a=n(4164),r=n(7751);const s="tabItem_Ymn6";var i=n(4848);function o({children:e,className:t,hidden:n}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,a.A)(s,t),hidden:n,children:e})}function l({children:e,className:t,value:n}){const{selectedValue:a,lazy:s}=(0,r.uc)(),l=n===a;return!l&&s?null:(0,i.jsx)(o,{className:t,hidden:!l,children:e})}},4865(e,t,n){n.d(t,{A:()=>h});n(6540);var a=n(4164),r=n(7559),s=n(7751),i=n(3104),o=n(2303);const l="tabList__CuJ",d="tabItem_LNqP";var u=n(4848);function c({className:e}){const{selectedValue:t,selectValue:n,tabValues:r,block:o}=(0,s.uc)(),l=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),p=e=>{const a=e.currentTarget,s=l.indexOf(a),i=r[s].value;i!==t&&(c(a),n(i))},m=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,u.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":o},e),children:r.map(({value:e,label:n,attributes:r})=>(0,u.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{l.push(e)},onKeyDown:m,onClick:p,...r,className:(0,a.A)("tabs__item",d,r?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function p({children:e}){return(0,u.jsx)("div",{className:"margin-top--md",children:e})}function m({className:e,children:t}){return(0,u.jsxs)("div",{className:(0,a.A)(r.G.tabs.container,"tabs-container",l),children:[(0,u.jsx)(c,{className:e}),(0,u.jsx)(p,{children:t})]})}function h(e){const t=(0,o.A)(),n=(0,s.OC)(e);return(0,u.jsx)(s.O_,{value:n,children:(0,u.jsx)(m,{className:e.className,children:(0,s.vT)(e.children)})},String(t))}},7751(e,t,n){n.d(t,{OC:()=>h,O_:()=>_,uc:()=>g,vT:()=>u});var a=n(6540),r=n(6347),s=n(205),i=n(7485),o=n(679),l=n(1682),d=n(4848);function u(e){return a.Children.toArray(e).filter(e=>"\n"!==e)}function c(e){const{values:t,children:n}=e;return(0,a.useMemo)(()=>{const e=t??function(e){return a.Children.toArray(e).flatMap(e=>{if(!e)return[];if((0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return[e];const t="string"==typeof e.type?e.type:e.type.name;throw new Error(`Docusaurus error: Bad <Tabs> child <${t}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.\nIf you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:t,attributes:n,default:a}})=>({value:e,label:t,attributes:n,default:a}))}(n);return function(e){const t=(0,l.XI)(e,(e,t)=>e.value===t.value);if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,n])}function p({value:e,tabValues:t}){return t.some(t=>t.value===e)}function m({queryString:e=!1,groupId:t}){const n=(0,r.W6)(),s=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,i.aZ)(s),(0,a.useCallback)(e=>{if(!s)return;const t=new URLSearchParams(n.location.search);t.set(s,e),n.replace({...n.location,search:t.toString()})},[s,n])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,i=c(e),[l,d]=(0,a.useState)(()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!p({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find(e=>e.default)??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:i})),[u,h]=m({queryString:n,groupId:r}),[f,g]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,r]=(0,o.Dv)(t);return[n,(0,a.useCallback)(e=>{t&&r.set(e)},[t,r])]}({groupId:r}),_=(()=>{const e=u??f;return p({value:e,tabValues:i})?e:null})();(0,s.A)(()=>{_&&d(_)},[_]);return{selectedValue:l,selectValue:(0,a.useCallback)(e=>{if(!p({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);d(e),h(e),g(e)},[h,g,i]),tabValues:i,lazy:e.lazy??!1,block:e.block??!1}}const f=(0,a.createContext)(null);function g(){const e=a.useContext(f);if(!e)throw new Error("useTabsContext() must be used within a Tabs component");return e}function _(e){return(0,d.jsx)(f.Provider,{value:e.value,children:e.children})}},2170(e,t,n){n.d(t,{d:()=>s,e:()=>l});var a=n(6540),r=n(4848);function s({mdPath:e}){const[t,n]=(0,a.useState)("idle");return(0,r.jsxs)("div",{className:"ai-md-toolbar",role:"group","aria-label":"Markdown tools",children:[(0,r.jsxs)("button",{className:"button button--secondary button--sm ai-md-copy-button",type:"button",onClick:async()=>{try{const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`Could not load ${e}`);const a=await t.text();await navigator.clipboard.writeText(a),n("copied"),setTimeout(()=>n("idle"),2500)}catch(t){n("error"),setTimeout(()=>n("idle"),3500)}},children:[(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"ai-md-copy-icon",children:(0,r.jsx)("path",{d:"M16 1H6a2 2 0 0 0-2 2v12h2V3h10V1Zm3 4H10a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 16H10V7h9v14Z"})}),"copied"===t?"Copied .md":"Copy page as .md"]}),(0,r.jsx)("a",{className:"button button--secondary button--sm",href:e,target:"_blank",rel:"noopener noreferrer",children:"Open .md"}),"error"===t&&(0,r.jsx)("span",{className:"ai-md-status",role:"status",children:"Couldn't copy. Open the .md and copy manually."})]})}const i=encodeURIComponent("Help me get started with the AudD Music Recognition API. Show me how to identify songs from audio files with code examples. Docs: https://docs.audd.io/.md https://docs.audd.io/streams.md https://docs.audd.io/enterprise.md"),o=[{name:"ChatGPT",url:`https://chatgpt.com/?hints=search&q=${i}`,icon:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 512 512",fill:"none",children:[(0,r.jsx)("rect",{width:"512",height:"512",rx:"80",fill:"#74AA9C"}),(0,r.jsx)("path",{d:"M236.057 63.7383C193.922 63.7383 156.49 90.8279 143.446 130.835L138.743 158.307V249.365C138.743 253.919 141.083 257.962 144.999 260.303L218.309 302.547V177.417H218.33V1
171.48L292.534 128.621C299.709 124.468 307.524 121.629 315.617 120.146L308.473 95.9139C290.044 75.3147 263.678 63.6107 236.057 63.7383ZM236.057 88.7425L235.929 88.8702C252.889 88.8702 269.19 94.7222 282.235 105.554C281.703 105.809 280.66 106.469 279.894 106.852L203.179 151.029C199.263 153.243 196.923 157.413 196.923 161.967V265.666L163.917 246.641V160.925C163.896 121.11 196.178 88.8063 236.057 88.7425Z",fill:"white"}),(0,r.jsx)("path",{d:"M412.82 142.277C391.753 105.787 349.577 86.9152 308.408 95.6215L282.264 105.285L203.406 150.814C199.462 153.091 197.131 157.14 197.061 161.701L197.132 246.311L305.498 183.746L305.509 183.765L310.65 180.796L384.868 223.629C392.053 227.766 398.419 233.115 403.75 239.382L421.163 221.079C429.789 194.82 426.742 166.134 412.82 142.277ZM391.166 154.779L390.992 154.732C399.472 169.42 402.554 186.463 399.696 203.176C399.209 202.843 398.116 202.27 397.401 201.798L320.785 157.449C316.911 155.165 312.128 155.223 308.184 157.5L218.379 209.349L218.352 171.254L292.585 128.395C327.055 108.469 371.171 120.275 391.166 154.779Z",fill:"white"}),(0,r.jsx)("path",{d:"M433.185 334.628C454.253 298.139 449.508 252.177 421.384 220.877L399.943 203.068L321.085 157.539C317.141 155.262 312.469 155.267 308.484 157.488L235.245 199.854L343.611 262.419L343.6 262.438L348.742 265.406L348.756 351.098C348.766 359.388 347.317 367.575 344.555 375.326L369.112 381.255C396.166 375.595 419.485 358.613 433.185 334.628ZM411.531 322.126L411.484 321.952C403.004 336.64 389.786 347.831 373.883 353.712C373.928 353.124 373.878 351.891 373.929 351.036L374.028 262.51C374.069 258.012 371.627 253.9 367.684 251.623L277.878 199.774L310.857 180.702L385.089 223.561C419.581 243.45 431.415 287.558 411.531 322.126Z",fill:"white"}),(0,r.jsx)("path",{d:"M276.787 448.44C318.921 448.44 356.353 421.351 369.398 381.344L374.101 353.871V262.814C374.101 258.26 371.76 254.217 367.845 251.876L294.535 209.632V334.762H294.513V340.699L220.31 383.557C213.135 387.711 205.32 390.549 197.227 392.033L204.371 416.265C222.799 436.864 249.165 448.568 276.787 448.44ZM276.787 423.436L276.915 423.309C259.955 423.309 243.654 417.457 230.609 406.625C231.141 406.37 232.184 405.71 232.95 405.327L309.665 361.149C313.58 358.936 315.921 354.765 315.921 350.211V246.513L348.927 265.538V351.254C348.948 391.069 316.666 423.372 276.787 423.436Z",fill:"white"}),(0,r.jsx)("path",{d:"M100.024 369.902C121.091 406.391 163.267 425.263 204.436 416.557L230.58 406.893L309.438 361.365C313.382 359.088 315.713 355.039 315.782 350.477L315.712 265.867L207.346 328.432L207.335 328.414L202.193 331.382L127.975 288.549C120.791 284.413 114.425 279.064 109.094 272.797L91.6803 291.099C83.0552 317.359 86.1022 346.044 100.024 369.902ZM121.678 357.399L121.852 357.446C113.372 342.758 110.29 325.715 113.148 309.003C113.635 309.336 114.728 309.909 115.442 310.381L192.059 354.729C195.933 357.013 200.716 356.955 204.66 354.678L294.465 302.829L294.492 340.925L220.259 383.783C185.789 403.709 141.672 391.904 121.678 357.399Z",fill:"white"}),(0,r.jsx)("path",{d:"M79.6584 177.55C58.5912 214.04 63.3355 260.002 91.4599 291.302L112.9 309.111L191.759 354.64C195.703 356.917 200.375 356.911 204.359 354.691L277.599 312.325L169.233 249.759L169.244 249.741L164.102 246.772L164.088 161.081C164.077 152.791 165.527 144.603 168.289 136.853L143.731 130.924C116.678 136.584 93.3586 153.565 79.6584 177.55ZM101.313 190.052L101.359 
1190.227C109.839 175.539 123.058 164.348 138.961 158.467C138.916 159.055 138.966 160.288 138.914 161.143L138.816 249.669C138.775 254.166 141.216 258.279 145.16 260.556L234.965 312.405L201.987 331.476L127.754 288.618C93.2631 268.729 81.4286 224.62 101.313 190.052Z",fill:"white"})]})},{name:"Claude",url:`https://claude.ai/new?q=${i}`,icon:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 512 512",fill:"none",children:[(0,r.jsx)("rect",{width:"512",height:"512",rx:"80",fill:"#D77655"}),(0,r.jsx)("path",{d:"M140.497 318.701L215.225 276.772L216.482 273.13L215.225 271.105H211.584L199.095 270.335L156.397 269.181L119.366 267.643L83.4895 265.719L74.4627 263.796L66 252.641L66.8719 247.076L74.4627 241.972L85.3359 242.921L109.365 244.563L145.421 247.05L171.578 248.589L210.327 252.615H216.482L217.354 250.127L215.251 248.589L213.61 247.05L176.297 221.765L135.907 195.043L114.75 179.656L103.313 171.86L97.5427 164.552L95.0552 148.601L105.441 137.163L119.392 138.112L122.956 139.061L137.087 149.934L167.27 173.297L206.686 202.326L212.456 207.122L214.764 205.48L215.046 204.326L212.456 199.992L191.017 161.244L168.142 121.828L157.961 105.492L155.268 95.6963C154.32 91.6701 153.627 88.2851 153.627 84.1563L165.449 68.1028L171.989 66L187.76 68.1028L194.402 73.8729L204.198 96.2861L220.072 131.573L244.691 179.554L251.897 193.786L255.744 206.968L257.18 210.994H259.667V208.686L261.693 181.657L265.437 148.473L269.079 105.775L270.335 93.7474L276.285 79.3351L288.107 71.5392L297.339 75.9501L304.93 86.8233L303.878 93.8499L299.365 123.187L290.517 169.142L284.747 199.916H288.107L291.954 196.069L307.52 175.399L333.677 142.703L345.217 129.727L358.681 115.391L367.323 108.57H383.658L395.686 126.444L390.3 144.908L373.477 166.244L359.527 184.324L339.524 211.25L327.035 232.792L328.189 234.51L331.164 234.228L376.35 224.611L400.763 220.2L429.895 215.2L443.077 221.354L444.513 227.612L439.332 240.408L408.174 248.102L371.631 255.41L317.213 268.284L316.547 268.771L317.316 269.72L341.832 272.028L352.321 272.592H377.991L425.792 276.157L438.281 284.414L445.769 294.518L444.513 302.211L425.279 312.008L399.327 305.853L338.755 291.441L317.983 286.261H315.111V287.979L332.421 304.904L364.143 333.549L403.866 370.477L405.892 379.606L400.789 386.813L395.403 386.043L360.501 359.783L347.038 347.961L316.547 322.291H314.521V324.984L321.547 335.267L358.655 391.044L360.578 408.149L357.886 413.714L348.269 417.073L337.703 415.15L315.982 384.658L293.569 350.32L275.49 319.547L273.284 320.804L262.616 435.717L257.616 441.589L246.076 446L236.459 438.691L231.356 426.869L236.459 403.507L242.614 373.016L247.614 348.782L252.128 318.675L254.82 308.674L254.641 308.007L252.435 308.289L229.74 339.447L195.223 386.095L167.911 415.329L161.372 417.919L150.037 412.047L151.088 401.558L157.423 392.224L195.223 344.14L218.021 314.341L232.74 297.134L232.638 294.646H231.766L131.368 359.835L113.494 362.143L105.8 354.936L106.749 343.114L110.391 339.268L140.574 318.496L140.472 318.598L140.497 318.701Z",fill:"#FCF2EE"})]})},{name:"Gemini",url:`https://gemini.google.com/app?q=${i}`,icon:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 512 512",fill:"none",children:[(0,r.jsx)("rect",{x:"3.5",y:"3.5",width:"505",height:"505",rx:"76.5",fill:"white"}),(0,r.jsx)("rect",{x:"3.5",y:"3.5",width:"505",height:"505",rx:"76.5",stroke:"#E7EAF2",strokeWidth:"7"}),(0,r.jsx)("path",{d:"M445.885 256.38C396.584 259.405 350.092 280.355 315.166 315.281C280.239 350.207 259.29 396.7 256.265 446H255.505C252.484 396.698 231.537 350.202 196.61 315.275C161.682 280.348 115.187 259.4 65.8848 256.38L65.8848 255.62C115.187 252.6 161.682 231.652 196.61 196.725C231.537 161.798 252.484 115.302 255.505 66L256.265 66C259.29 115.3 280.239 161.793 315.166 196.719C350.092 231.645 396.584 252.595 445.885 25
15.62V256.38Z",fill:"url(#gemini_grad)"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("radialGradient",{id:"gemini_grad",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(103.6 220.446) rotate(18.6832) scale(404.463 3240)",children:[(0,r.jsx)("stop",{offset:"0.067",stopColor:"#9168C0"}),(0,r.jsx)("stop",{offset:"0.343",stopColor:"#5684D1"}),(0,r.jsx)("stop",{offset:"0.672",stopColor:"#1BA1E3"})]})})]})},{name:"Grok",url:`https://grok.com/?q=${i}`,icon:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 512 512",fill:"none",children:[(0,r.jsx)("rect",{width:"512",height:"512",rx:"80",fill:"black"}),(0,r.jsx)("path",{d:"M210.844 309.922L342.437 212.664C348.889 207.896 358.11 209.756 361.184 217.162C377.363 256.22 370.135 303.159 337.945 335.387C305.756 367.613 260.969 374.681 220.032 358.584L175.312 379.315C239.453 423.208 317.342 412.353 366.014 363.59C404.621 324.937 416.578 272.249 405.398 224.737L405.499 224.838C389.286 155.04 409.485 127.141 450.861 70.0919C451.84 68.7392 452.819 67.3865 453.799 66L399.351 120.513V120.344L210.811 309.956",fill:"white"}),(0,r.jsx)("path",{d:"M183.687 333.559C137.649 289.528 145.587 221.387 184.869 182.093C213.916 153.01 261.508 141.14 303.053 158.589L347.672 137.961C339.634 132.145 329.331 125.888 317.51 121.492C264.075 99.4774 200.102 110.434 156.665 153.889C114.884 195.72 101.745 260.04 124.308 314.926C141.162 355.946 113.533 384.96 85.7008 414.246C75.838 424.627 65.9415 435.01 57.9702 446L183.653 333.592",fill:"white"})]})}];function l(){return(0,r.jsxs)("div",{className:"ai-md-footer",children:[(0,r.jsx)("hr",{}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"For AI chatbots/agents:"})," Markdown versions of these docs are available."]}),(0,r.jsxs)("p",{className:"ai-md-links",children:[(0,r.jsx)("span",{className:"ai-md-links-label",children:"HTTP API:"})," ",(0,r.jsx)("a",{href:"/.md",target:"_blank",rel:"noopener noreferrer",children:"/.md"})," \xb7 ",(0,r.jsx)("a",{href:"/streams.md",target:"_blank",rel:"noopener noreferrer",children:"/streams.md"})," \xb7 ",(0,r.jsx)("a",{href:"/enterprise.md",target:"_blank",rel:"noopener noreferrer",children:"/enterprise.md"})]}),(0,r.jsxs)("p",{className:"ai-md-links",children:[(0,r.jsx)("span",{className:"ai-md-links-label",children:"SDKs:"})," ",(0,r.jsx)("a",{href:"/sdks.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/python.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/python.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/node.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/node.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/go.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/go.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/rust.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/rust.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/php.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/php.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/swift.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/swift.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/kotlin.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/kotlin.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/dotnet.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/dotnet.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/java.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/java.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/c.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/c.md"})," \xb7 ",(0,r.jsx)("a",{href:"/sdks/cpp.md",target:"_blank",rel:"noopener noreferrer",children:"/sdks/cpp.md"})]}),(0,r.jsxs)("div",{className:"ask-ai-buttons",role:"group","aria-label":"Ask AI about the API",children:[(0,r.jsx)("span",{className:"ask-ai-label",children:"Ask about the API:"}),o.map(({name:e,url:t,icon:n})=>(0,r.jsx)("a",{className:"ask-ai-button",href:t,target:"_blank",rel:"noopener noreferrer",title:`Ask ${e}`,"aria-label":`Ask ${e} about the AudD API`,children:n},e))]})]})}},9142(e,t,n){n.d(t,{W5:()=>w,WA:()=>$,YK:()=>b});n(6540);var a=n(4865),r=n(9365),s=n(8149);const i=[{value:"python",label:"Python",codeLang:"python"},{value:"node",label:"Node",codeLang:"typescript"},{value:"go",label:"Go",codeLang:"go"},{value:"rust",label:"Rust",codeLang:"rust"},{value:"php",label:"PHP",codeLang:"php"},{value:"swift",label:"Swift",codeLang:"swift"},{value:"kotlin",label:"Kotlin",codeLang:"kotlin"},{value:"dotnet",label:"C#",codeLang:"csharp"},{value:"java",label:"Java",codeLang:"java"},{value:"c",label:"C",codeLang:"c"},{value:"cpp",label:"C++",codeLang:"cpp"}],o={python:{lang:"bash",code:"pip install audd"},node:{lang:"bash",code:"npm install @audd/sdk"},go:{lang:"bash",code:"go get github.com/AudDMusic/audd-go"},rust:{lang:"bash",code:"cargo add audd"},php:{lang:"bash",code:"composer require audd/audd"},swift:{lang:"swift",code:`// Package.swift, in dependencies:\n.package(url: "https://github.com/AudDMusic/audd-swift", from: "${"1.5.19"}"),`},kotlin:{lang:"kotlin",code:`// build.gradle.kts\nimplementation("io.audd:audd-kotlin:${"1.5.16"}")`},dotnet:{lang:"bash",code:"dotnet add package AudD"},java:{lang:"xml",code:`\x3c!-- pom.xml --\x3e\n<dependency>\n  <groupId>io.audd</groupId>\n  <artifactId>audd</artifactId>\n  <version>${"1.5.16"}</version>\n</dependency>`},c:{lang:"cmake",code:`# CMakeLists.txt\nFetchContent_Declare(audd\n    GIT_REPOSITORY https://github.com/AudDMusic/audd-c.git\n    GIT_TAG        v${"1.5.16"})\nFetchContent_MakeAvailable(audd)\ntarget_link_libraries(your_app PRIVATE audd)`},cpp:{lang:"cmake",code:"# CMakeLists.txt (after installing audd-cpp)\nfind_package(audd CONFIG REQUIRED)\ntarget_link_libraries(your_app PRIVATE audd::audd)"}},l={recognize:"recognize-a-clip",enterprise:"process-a-long-audio-file",customCatalog:"add-a-song-to-your-custom-catalog",addStream:"monitor-a-live-audio-stream",setStreamUrl:"monitor-a-live-audio-stream",deleteStream:"monitor-a-live-audio-stream",getStreams:"monitor-a-live-audio-stream",setCallbackUrl:"receive-callbacks-from-a-stream",getCallbackUrl:"receive-callbacks-from-a-stream",longpoll:"poll-for-stream-events-longpoll"},d={"":"recognize",recognize:"recognize",setCallbackUrl:"setCallbackUrl",addStream:"addStream",getCallbackUrl:"getCallbackUrl",getStreams:"getStreams",setStreamUrl:"setStreamUrl",deleteStream:"deleteStream",longpoll:"longpoll",upload:"customCatalog"},u=e=>{if(!e)return null;if(/enterprise\.audd\.io/.test(e))return"enterprise";const t=/^https:\/\/api\.audd\.io\/([a-zA-Z]*)\/?$/.exec(e);return t?d[t[1]]??null:null},c={recognize_file:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nwith open("/path/to/clip.mp3", "rb") as f:\n    result = audd.recognize(f)\nprint(f"{result.artist} \u2014 {result.title}")',node:'import { AudD } from "@audd/sdk";\nimport { readFile } from "node:fs/promises";\n\nconst audd = new AudD("your-api-token");\nconst buf = await readFile("/path/to/clip.mp3");\nconst song = await audd.recognize(buf);\nif (song) console.log(`${song.artist} \u2014 ${song.title}`);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nf, _ := os.Open("/path/to/clip.mp3")\ndefer f.Close()\n\nresult, _ := client.Recognize(f, nil)\nfmt.Printf("%s \u2014 %s\\n", result.Artist, result.Title)',rust:'let client = audd::AudD::new("your-api-token");
1\nlet result = client.recognize(std::path::Path::new("/path/to/clip.mp3")).await?;\nif let Some(song) = result {\n    println!("{} \u2014 {}", song.artist.unwrap_or_default(), song.title.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$song = $audd->recognize('/path/to/clip.mp3');\nif ($song !== null) {\n    echo \"{$song->artist} \u2014 {$song->title}\\n\";\n}",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet file = URL(fileURLWithPath: "/path/to/clip.mp3")\nif let song = try await audd.recognize(.file(file)) {\n    print("\\(song.artist ?? "") \u2014 \\(song.title ?? "")")\n}',kotlin:'val audd = AudD("your-api-token")\nval song = audd.recognize(Source.FilePath(File("/path/to/clip.mp3")))\nprintln("${song?.artist} \u2014 ${song?.title}")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar song = await audd.RecognizeAsync("/path/to/clip.mp3");\nConsole.WriteLine($"{song?.Artist} \u2014 {song?.Title}");',java:'try (AudD audd = new AudD("your-api-token")) {\n    RecognitionResult song = audd.recognize(Path.of("/path/to/clip.mp3"));\n    if (song != null) System.out.println(song.artist() + " \u2014 " + song.title());\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_recognition_t* result = NULL;\naudd_recognize(client, "/path/to/clip.mp3", NULL, &result);\nif (result) {\n    printf("%s \u2014 %s\\n", audd_recognition_get_artist(result), audd_recognition_get_title(result));\n}\naudd_recognition_free(result);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nauto song = client.recognize(audd::SourceFilePath{"/path/to/clip.mp3"});\nif (song) std::cout << song->artist << " \u2014 " << song->title << "\\n";'},recognize:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nresult = audd.recognize("https://audd.tech/example.mp3")\nprint(f"{result.artist} \u2014 {result.title}")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nconst song = await audd.recognize("https://audd.tech/example.mp3");\nif (song) console.log(`${song.artist} \u2014 ${song.title}`);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nresult, _ := client.Recognize("https://audd.tech/example.mp3", nil)\nfmt.Printf("%s \u2014 %s\\n", result.Artist, result.Title)',rust:'let client = audd::AudD::new("your-api-token");\nlet result = client.recognize("https://audd.tech/example.mp3").await?;\nif let Some(song) = result {\n    println!("{} \u2014 {}", song.artist.unwrap_or_default(), song.title.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$song = $audd->recognize('https://audd.tech/example.mp3');\nif ($song !== null) {\n    echo \"{$song->artist}
1 \u2014 {$song->title}\\n\";\n}",swift:'let audd = try AudD(apiToken: "your-api-token")\nif let song = try await audd.recognize("https://audd.tech/example.mp3") {\n    print("\\(song.artist ?? "") \u2014 \\(song.title ?? "")")\n}',kotlin:'val audd = AudD("your-api-token")\nval song = audd.recognize(Source.Url("https://audd.tech/example.mp3"))\nprintln("${song?.artist} \u2014 ${song?.title}")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar song = await audd.RecognizeAsync("https://audd.tech/example.mp3");\nConsole.WriteLine($"{song?.Artist} \u2014 {song?.Title}");',java:'try (AudD audd = new AudD("your-api-token")) {\n    RecognitionResult song = audd.recognize("https://audd.tech/example.mp3");\n    if (song != null) System.out.println(song.artist() + " \u2014 " + song.title());\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_recognition_t* result = NULL;\naudd_recognize(client, "https://audd.tech/example.mp3", NULL, &result);\nif (result) {\n    printf("%s \u2014 %s\\n", audd_recognition_get_artist(result), audd_recognition_get_title(result));\n}\naudd_recognition_free(result);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nauto song = client.recognize("https://audd.tech/example.mp3");\nif (song) std::cout << song->artist << " \u2014 " << song->title << "\\n";'},enterprise_file:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nmatches = audd.recognize_enterprise("/path/to/full-show.mp3", limit=10)\nfor m in matches:\n    print(f"{m.timecode}  {m.artist} \u2014 {m.title}")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nconst matches = await audd.recognizeEnterprise("/path/to/full-show.mp3", { limit: 10 });\nfor (const m of matches) console.log(`${m.timecode}  ${m.artist} \u2014 ${m.title}`);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nf, _ := os.Open("/path/to/full-show.mp3")\ndefer f.Close()\n\nlimit := 10\nmatches, _ := client.RecognizeEnterprise(f, &audd.EnterpriseOptions{Limit: &limit})\nfor _, m := range matches {\n    fmt.Printf("%s  %s \u2014 %s\\n", m.Timecode, m.Artist, m.Title)\n}',rust:'use audd::EnterpriseOptions;\n\nlet client = audd::AudD::new("your-api-token");\nlet matches = client.recognize_enterprise(\n    std::path::Path::new("/path/to/full-show.mp3"),\n    EnterpriseOptions { limit: Some(10), ..Default::default() },\n).await?;\nfor m in matches {\n    println!("{}  {} \u2014 {}", m.timecode.unwrap_or_default(),\n        m.artist.unwrap_or_default(), m.title.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$matches = $audd->recognizeEnterprise('/path/to/full-show.mp3', limit: 10);\nforeach ($matches as $m) {\n    echo \"{$m->timecode}  {$m->artist} \u2014 {$m->title}\\n\";\n}",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet file = URL(fileURLWithPath: "/path/to/full-show.mp3")\nlet matches = try await audd.recognizeEnterprise(.file(file), limit: 10)\nfor m in matches { print("\\(m.timecode ?? "")  \\(m.artist ?? "") \u2014 \\(m.title ?? "")") }',kotlin:'val audd = AudD("your-api-token")\nval matches = audd.recognizeEnterprise(\n    Source.FilePath(File("/path/to/full-show.mp3")),\n    limit = 10,\n)\nfor (m in matches) println("${m.timecode}  ${m.artist} \u2014 ${m.title}")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar matches = await audd.RecognizeEnterpriseAsync("/path/to/full-show.mp3", limit: 10);\nforeach (var m in matches) Console.WriteLine($"{m.Timecode}  {m.Artist} \u2014 {m.Title}");',java:'try (AudD audd = new AudD("your-api-token")) {\n    var opts = new EnterpriseOptions.Builder().limit(10).build();\n    List<EnterpriseMatch> matches = audd.recognizeEnterprise(\n        Path.of("/path/to/full-show.mp3"), opts);\n    for (var m : matches) {\n        System.out.println(m.timecode() + "  " + m.artist() + " \u2014 " + m.title());\n    }\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_enterprise_options_t opts = audd_enterprise_options_default();\nopts.limit = 10;\naudd_enterprise_result_t* result = NULL;
1\naudd_recognize_enterprise(client, "/path/to/full-show.mp3", &opts, &result);\nfor (size_t i = 0; i < audd_enterprise_result_count(result); ++i) {\n    const audd_enterprise_match_t* m = audd_enterprise_result_at(result, i);\n    printf("%s  %s \u2014 %s\\n", audd_enterprise_match_get_timecode(m),\n           audd_enterprise_match_get_artist(m), audd_enterprise_match_get_title(m));\n}\naudd_enterprise_result_free(result);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\naudd::EnterpriseOptions opts; opts.limit = 10;\nauto matches = client.recognize_enterprise(\n    audd::SourceFilePath{"/path/to/full-show.mp3"}, opts);\nfor (auto& m : matches) {\n    std::cout << m.timecode << "  " << m.artist << " \u2014 " << m.title << "\\n";\n}'},enterprise:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nmatches = audd.recognize_enterprise("https://example.com/full-show.mp3", limit=10)\nfor m in matches:\n    print(f"{m.timecode}  {m.artist} \u2014 {m.title}")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nconst matches = await audd.recognizeEnterprise("https://example.com/full-show.mp3", { limit: 10 });\nfor (const m of matches) console.log(`${m.timecode}  ${m.artist} \u2014 ${m.title}`);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nlimit := 10\nmatches, _ := client.RecognizeEnterprise("https://example.com/full-show.mp3",\n    &audd.EnterpriseOptions{Limit: &limit})\nfor _, m := range matches {\n    fmt.Printf("%s  %s \u2014 %s\\n", m.Timecode, m.Artist, m.Title)\n}',rust:'use audd::EnterpriseOptions;\n\nlet client = audd::AudD::new("your-api-token");\nlet matches = client.recognize_enterprise(\n    "https://example.com/full-show.mp3",\n    EnterpriseOptions { limit: Some(10), ..Default::default() },\n).await?;\nfor m in matches {\n    println!("{}  {} \u2014 {}", m.timecode.unwrap_or_default(),\n        m.artist.unwrap_or_default(), m.title.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$matches = $audd->recognizeEnterprise('https://example.com/full-show.mp3', limit: 10);\nforeach ($matches as $m) {\n    echo \"{$m->timecode}  {$m->artist} \u2014 {$m->title}\\n\";\n}",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet url = URL(string: "https://example.com/full-show.mp3")!\nlet matches = try await audd.recognizeEnterprise(.url(url), limit: 10)\nfor m in matches { print("\\(m.timecode ?? "")  \\(m.artist ?? "") \u2014 \\(m.title ?? "")") }',kotlin:'val audd = AudD("your-api-token")\nval matches = audd.recognizeEnterprise(\n    Source.Url("https://example.com/full-show.mp3"),\n    limit = 10,\n)\nfor (m in matches) println("${m.timecode}  ${m.artist} \u2014 ${m.title}")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar matches = await audd.RecognizeEnterpriseAsync("https://example.com/full-show.mp3", limit: 10);\nforeach (var m in matches) Console.WriteLine($"{m.Timecode}  {m.Artist} \u2014 {m.Title}");',java:'try (AudD audd = new AudD("your-api-token")) {\n    var opts = new EnterpriseOptions.Builder().limit(10).build();\n    List<EnterpriseMatch> matches = audd.recognizeEnterprise(\n        "https://example.com/full-show.mp3", opts);\n    for (var m : matches) {\n        System.out.println(m.timecode() + "  " + m.artist() + " \u2014 " + m.title());\n    }\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_enterprise_options_t opts = audd_enterprise_options_default();\nopts.limit = 10;\naudd_enterprise_result_t* result = NULL;\naudd_recognize_enterprise(client, "https://example.com/full-show.mp3", &opts, &result);\nfor (size_t i = 0; i < audd_enterprise_result_count(result); ++i) {\n    const audd_enterprise_match_t* m = audd_enterprise_result_at(result, i);\n    printf("%s  %s \u2014 %s\\n", audd_enterprise_match_get_timecode(m),\n           audd_enterprise_match_get_artist(m), audd_enterprise_match_get_title(m));\n}\naudd_enterprise_result_free(result);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\naudd::EnterpriseOptions opts; opts.limit = 10;
1\nauto matches = client.recognize_enterprise(\n    "https://example.com/full-show.mp3", opts);\nfor (auto& m : matches) {\n    std::cout << m.timecode << "  " << m.artist << " \u2014 " << m.title << "\\n";\n}'},customCatalog:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\naudd.custom_catalog.add(audio_id=42, source="https://my.song.mp3")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nawait audd.customCatalog.add({ audioId: 42, source: "https://my.song.mp3" });',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nclient.CustomCatalog().Add(42, "https://my.song.mp3")',rust:'let client = audd::AudD::new("your-api-token");\nclient.custom_catalog().add(42, "https://my.song.mp3").await?;',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$audd->customCatalog()->add(audioId: 42, source: 'https://my.song.mp3');",swift:'let audd = try AudD(apiToken: "your-api-token")\ntry await audd.customCatalog.add(audioID: 42, source: .url(URL(string: "https://my.song.mp3")!))',kotlin:'val audd = AudD("your-api-token")\naudd.customCatalog.add(audioId = 42, source = Source.Url("https://my.song.mp3"))',dotnet:'using var audd = new AudD.AudD("your-api-token");\nawait audd.CustomCatalog.AddAsync(42, "https://my.song.mp3");',java:'try (AudD audd = new AudD("your-api-token")) {\n    audd.customCatalog().add(42, "https://my.song.mp3");\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_custom_catalog_add(client, 42, "https://my.song.mp3");\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nclient.custom_catalog().add(42, "https://my.song.mp3");'},addStream:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\naudd.streams.add(\n    url="https://npr-ice.streamguys1.com/live.mp3",\n    radio_id=3249,\n
1)',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nawait audd.streams.add({\n  url: "https://npr-ice.streamguys1.com/live.mp3",\n  radioId: 3249,\n});',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nclient.Streams().Add(audd.AddStreamRequest{\n    URL:     "https://npr-ice.streamguys1.com/live.mp3",\n    RadioID: 3249,\n})',rust:'let client = audd::AudD::new("your-api-token");\nclient.streams().add(\n    "https://npr-ice.streamguys1.com/live.mp3",\n    3249,  // radio_id\n    None,  // callbacks\n    None,  // extra_parameters\n).await?;',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$audd->streams()->add(\n    url: 'https://npr-ice.streamguys1.com/live.mp3',\n    radioId: 3249,\n);",swift:'let audd = try AudD(apiToken: "your-api-token")\ntry await audd.streams.add(\n    url: "https://npr-ice.streamguys1.com/live.mp3",\n    radioID: 3249\n)',kotlin:'val audd = AudD("your-api-token")\naudd.streams.add(\n    url = "https://npr-ice.streamguys1.com/live.mp3",\n    radioId = 3249,\n)',dotnet:'using var audd = new AudD.AudD("your-api-token");\nawait audd.Streams.AddAsync(\n    url: "https://npr-ice.streamguys1.com/live.mp3",\n    radioId: 3249);',java:'try (AudD audd = new AudD("your-api-token")) {\n    audd.streams().add(new AddStreamRequest("https://npr-ice.streamguys1.com/live.mp3", 3249));\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_add_stream_request_t req = {\n    .url = "https://npr-ice.streamguys1.com/live.mp3",\n    .radio_id = 3249,\n};\naudd_streams_add(client, &req);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nclient.streams().add({\n    .url = "https://npr-ice.streamguys1.com/live.mp3",\n    .radio_id = 3249,\n});'},setCallbackUrl:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\naudd.streams.set_callback_url("https://your-server.example/audd-callback")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nawait audd.streams.setCallbackUrl("https://your-server.example/audd-callback");',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nclient.Streams().SetCallbackUrl("https://your-server.example/audd-callback", nil)',rust:'let client = audd::AudD::new("your-api-token");\nclient.streams().set_callback_url("https://your-server.example/audd-callback", None, None).await?;',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$audd->streams()->setCallbackUrl('https://your-server.example/audd-callback');",swift:'let audd = try AudD(apiToken: "your-api-token")\ntry await audd.streams.setCallbackURL("https://your-server.example/audd-callback")',kotlin:'val audd = AudD("your-api-token")\naudd.streams.setCallbackUrl("https://your-server.example/audd-callback")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nawait audd.Streams.SetCallbackUrlAsync("https://your-server.example/audd-callback");',java:'try (AudD audd = new AudD("your-api-token")) {\n    audd.streams().setCallbackUrl("https://your-server.example/audd-callback");\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_streams_set_callback_url(client, "https://your-server.example/audd-callback", NULL);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nclient.streams().set_callback_url("https://your-server.example/audd-callback");'},getCallbackUrl:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nurl = audd.streams.get_callback_url()\nprint(url)',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nconst url = await audd.streams.getCallbackUrl();\nconsole.log(url);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nurl, _ := client.Streams().GetCallbackUrl()\nfmt.Println(url)',rust:'let client = audd::AudD::new("your-api-token");\nlet url = client.streams().get_callback_url().await?;\nprintln!("{}", url.unwrap_or_default());',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$url = $audd->streams()->getCallbackUrl();\necho $url;",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet url = try await audd.streams.getCallbackURL()\nprint(url)',kotlin:'val audd = AudD("your-api-token")\nval url = audd.streams.getCallbackUrl()\nprintln(url)',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar url = await audd.Streams.GetCallbackUrlAsync();\nConsole.WriteLine(url);',java:'try (AudD audd = new AudD("your-api-token")) {\n    String url = audd.streams().getCallbackUrl();\n    System.out.println(url);\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\nchar* url = NULL;
1\naudd_streams_get_callback_url(client, &url);\nprintf("%s\\n", url ? url : "");\naudd_string_free(url);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nauto url = client.streams().get_callback_url();\nstd::cout << url << "\\n";'},setStreamUrl:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\naudd.streams.set_url(\n    radio_id=3249,\n    url="https://new-stream.example/live.mp3",\n)',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nawait audd.streams.setUrl(3249, "https://new-stream.example/live.mp3");',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nclient.Streams().SetURL(3249, "https://new-stream.example/live.mp3")',rust:'let client = audd::AudD::new("your-api-token");\nclient.streams().set_url(3249, "https://new-stream.example/live.mp3").await?;',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$audd->streams()->setUrl(\n    radioId: 3249,\n    url: 'https://new-stream.example/live.mp3',\n);",swift:'let audd = try AudD(apiToken: "your-api-token")\ntry await audd.streams.setURL(\n    radioID: 3249,\n    url: "https://new-stream.example/live.mp3"\n)',kotlin:'val audd = AudD("your-api-token")\naudd.streams.setUrl(\n    radioId = 3249,\n    url = "https://new-stream.example/live.mp3",\n)',dotnet:'using var audd = new AudD.AudD("your-api-token");\nawait audd.Streams.SetUrlAsync(3249, "https://new-stream.example/live.mp3");',java:'try (AudD audd = new AudD("your-api-token")) {\n    audd.streams().setUrl(3249, "https://new-stream.example/live.mp3");\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_streams_set_url(client, 3249, "https://new-stream.example/live.mp3");\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nclient.streams().set_url(3249, "https://new-stream.example/live.mp3");'},deleteStream:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\naudd.streams.delete(radio_id=3249)',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nawait audd.streams.delete(3249);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nclient.Streams().Delete(3249)',rust:'let client = audd::AudD::new("your-api-token");\nclient.streams().delete(3249).await?;',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$audd->streams()->delete(radioId: 3249);",swift:'let audd = try AudD(apiToken: "your-api-token")\ntry await audd.streams.delete(radioID: 3249)',kotlin:'val audd = AudD("your-api-token")\naudd.streams.delete(radioId = 3249)',dotnet:'using var audd = new AudD.AudD("your-api-token");\nawait audd.Streams.DeleteAsync(3249);',java:'try (AudD audd = new AudD("your-api-token")) {\n    audd.streams().delete(3249);\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_streams_delete(client, 3249);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nclient.streams().del(3249);'},getStreams:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\nstreams = audd.streams.list()\nfor s in streams:\n    print(f"{s.radio_id}  {s.url}")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\nconst streams = await audd.streams.list();\nfor (const s of streams) console.log(`${s.radioId}  ${s.url}`);',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nstreams, _ := client.Streams().List()\nfor _, s := range streams {\n    fmt.Printf("%d  %s\\n", s.RadioID, s.URL)\n}',rust:'let client = audd::AudD::new("your-api-token");\nlet streams = client.streams().list().await?;\nfor s in streams {\n    println!("{}  {}", s.radio_id.unwrap_or_default(), s.url.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$streams = $audd->streams()->list();\nforeach ($streams as $s) {\n    echo \"{$s->radio_id}  {$s->url}\\n\";\n}",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet streams = try await audd.streams.list()\nfor s in streams { print("\\(s.radioID ?? 0)  \\(s.url ?? "")") }',kotlin:'val audd = AudD("your-api-token")\nval streams = audd.streams.list()\nfor (s in streams) println("${s.radioId}  ${s.url}")',dotnet:'using var audd = new AudD.AudD("your-api-token");\nvar streams = await audd.Streams.ListAsync();
1\nforeach (var s in streams) Console.WriteLine($"{s.RadioId}  {s.Url}");',java:'try (AudD audd = new AudD("your-api-token")) {\n    List<Stream> streams = audd.streams().list();\n    for (var s : streams) {\n        System.out.println(s.radioId() + "  " + s.url());\n    }\n}',c:'audd_client_t* client = audd_client_new("your-api-token", NULL);\naudd_stream_list_t* streams = NULL;\naudd_streams_list(client, &streams);\nfor (size_t i = 0; i < audd_stream_list_count(streams); ++i) {\n    const audd_stream_t* s = audd_stream_list_at(streams, i);\n    printf("%d  %s\\n", audd_stream_get_radio_id(s), audd_stream_get_url(s));\n}\naudd_stream_list_free(streams);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nauto streams = client.streams().list();\nfor (auto& s : streams) std::cout << s.radio_id << "  " << s.url << "\\n";'},longpoll:{python:'from audd import AudD\n\naudd = AudD("your-api-token")\n\nradio_id = 1  # any integer you choose \u2014 your handle for this stream\n\nwith audd.streams.longpoll(radio_id=radio_id) as poll:\n    for match in poll.matches:\n        print(f"{match.song.artist} \u2014 {match.song.title}")',node:'import { AudD } from "@audd/sdk";\n\nconst audd = new AudD("your-api-token");\n\nconst radioId = 1; // any integer you choose \u2014 your handle for this stream\n\nconst poll = await audd.streams.longpoll({ radioId });\nfor await (const m of poll.matches) {\n  console.log(`${m.song?.artist} \u2014 ${m.song?.title}`);\n}',go:'client := audd.NewClient("your-api-token")\ndefer client.Close()\n\nradioID := 1 // any integer you choose \u2014 your handle for this stream\n\npoll, _ := client.Streams().LongpollByRadioID(radioID, nil)\ndefer poll.Close()\nfor m := range poll.Matches {\n    fmt.Printf("%s \u2014 %s\\n", m.Song.Artist, m.Song.Title)\n}',rust:'use futures_util::StreamExt;  // cargo add futures-util\n\nlet client = audd::AudD::new("your-api-token");\nlet radio_id = 1i64; // any integer you choose \u2014 your handle for this stream\n\nlet mut poll = client.streams().longpoll_by_radio_id(radio_id, Default::default()).await?;\nwhile let Some(m) = poll.matches.next().await {\n    println!("{} \u2014 {}", m.song.artist.unwrap_or_default(), m.song.title.unwrap_or_default());\n}',php:"<?php\n$audd = new AudD\\AudD('your-api-token');\n$radioId = 1; // any integer you choose \u2014 your handle for this stream\n\n$poll = $audd->streams()->longpoll(radioId: $radioId);\n$poll->onMatch(function ($m) {\n    echo \"{$m->song->artist} \u2014 {$m->song->title}\\n\";\n});\n$poll->run();",swift:'let audd = try AudD(apiToken: "your-api-token")\nlet radioID = 1 // any integer you choose \u2014 your handle for this stream\n\nlet poll = try await audd.streams.longpoll(radioID: radioID)\nfor await m in poll.matches {\n    print("\\(m.song?.artist ?? "") \u2014 \\(m.song?.title ?? "")")\n}',kotlin:'val audd = AudD("your-api-token")\nval radioId = 1L // any integer you choose \u2014 your handle for this stream\n\naudd.streams.longpoll(radioId).matches.collect { m ->\n    println("${m.song?.artist} \u2014 ${m.song?.title}")\n}',dotnet:'using var audd = new AudD.AudD("your-api-token");\nlong radioId = 1; // any integer you choose \u2014 your handle for this stream\n\nawait using var poll = await audd.Streams.LongpollAsync(radioId);\nawait foreach (var m in poll.Matches) {\n    Console.WriteLine($"{m.Song.Artist} \u2014 {m.Song.Title}");\n}',java:'try (AudD audd = new AudD("your-api-token")) {\n    int radioId = 1; // any integer you choose \u2014 your handle for this stream\n\n    try (var poll = audd.streams().longpoll(radioId)) {\n        poll.onMatch(m -> System.out.println(m.song().artist() + " \u2014 " + m.song().title()));\n        poll.run();\n    }\n}',c:'static void on_match(const audd_stream_callback_match_t* match, void* user_data) {\n    const audd_stream_callback_song_t* song = audd_stream_callback_match_get_song(match);\n    printf("%s \u2014 %s\\n", audd_stream_callback_song_get_artist(song),\n           audd_stream_callback_song_get_title(song));\n}\n\naudd_client_t* client = audd_client_new("your-api-token", NULL);\nint radio_id = 1; /* any integer you choose \u2014 your handle for this stream */\n\naudd_longpoll_callbacks_t cb = { .on_match = on_match };\naudd_longpoll_t* handle = NULL;\n/* blocks until audd_longpoll_close(handle) is called from another thread */\naudd_longpoll_run_by_radio_id(client, radio_id, NULL, &cb, &handle);\naudd_client_free(client);',cpp:'audd::AudD client("your-api-token");\nint radio_id = 1; // any integer you choose \u2014 your handle for this stream\n\nauto poll = client.streams().longpoll(radio_id);\nwhile (auto m = poll.next_match()) {\n    std::cout << m->song.artist << " \u2014 " << m->song.title << "\\n";\n}'}},p={api_token:"your-api-token",url:"https://audd.tech/example.mp3",file:"/p
1ath/to/clip.mp3",radio_id:"1",callbacks:"",return:"",market:"",accurate_offsets:"",skip:"",every:"",limit:"",skip_first_seconds:"",audio_id:"1",q:"imagine dragons warriors"};function m(e,t){const n=e.find(e=>e.name===t);return n&&void 0!==n.example&&""!==n.example?String(n.example):p[t]??""}function h(e,t,n){const a=function(e,t){const n=new Set(t);n.add("api_token"),n.add("url"),n.add("file");const a=[];for(const r of e)void 0!==r.example&&""!==r.example&&(n.has(r.name)||a.push([r.name,String(r.example)]));return a}(e,t);if(!a.length)return"";let r=`${n}ExtraParameters: map[string]string{\n`;for(const[s,i]of a)r+=`${n}    "${s}": "${i}",\n`;return r+=`${n}},\n`,r}const f={recognize:function(e,t){const n=m(e,"api_token"),a=m(e,"return"),r=m(e,"market"),s=h(e,["return","market"],"        "),i=a||r||s,o=t?'import (\n    "fmt"\n    "log"\n    "os"\n\n    audd "github.com/AudDMusic/audd-go"\n)':'import (\n    "fmt"\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)';let l="func main() {\n";l+=`    client := audd.NewClient("${n}")\n`,l+="    defer client.Close()\n\n";let d=`"${m(e,"url")}"`;return t&&(l+=`    f, err := os.Open("${m(e,"file")}")\n`,l+="    if err != nil {\n        log.Fatal(err)\n    }\n",l+="    defer f.Close()\n\n",d="f"),i?(l+=`    result, err := client.Recognize(${d}, &audd.RecognizeOptions{\n`,a&&(l+=`        ReturnMetadata: "${a}",\n`),r&&(l+=`        Market: "${r}",\n`),l+=s,l+="    })\n"):l+=`    result, err := client.Recognize(${d}, nil)\n`,l+="    if err != nil {\n        log.Fatal(err)\n    }\n",l+='    if result == nil {\n        fmt.Println("no match")\n        return\n    }\n\n',l+="    // Always-present fields.\n",l+='    fmt.Printf("%s \u2014 %s\\n", result.Artist, result.Title)\n',l+='    fmt.Println("Album:      ", result.Album)\n',l+='    fmt.Println("Released:   ", result.ReleaseDate)\n',l+='    fmt.Println("Label:      ", result.Label)\n',l+='    fmt.Println("Timecode:   ", result.Timecode)\n',l+='    fmt.Println("AudD link:  ", result.SongLink)\n\n',l+="    // Helpers \u2014 work without any Return opt-in.\n",l+='    fmt.Println("Thumbnail:  ", result.ThumbnailURL())\n',l+='    fmt.Println("Preview:    ", result.PreviewURL())\n',l+='    fmt.Println("On Spotify: ", result.StreamingURL(audd.ProviderSpotify))\n\n',l+="    // Provider blocks \u2014 populated only when requested via Return.\n",l+='    if result.AppleMusic != nil {\n        fmt.Println("Apple Music URL:", result.AppleMusic.URL)\n    }\n',l+='    if result.Spotify != nil {\n        fmt.Println("Spotify URI:    ", result.Spotify.URI)\n    }\n',l+='    if result.Deezer != nil {\n        fmt.Println("Deezer link:    ", result.Deezer.Link)\n    }\n',l+='    if len(result.MusicBrainz) > 0 {\n        fmt.Println("MusicBrainz ID: ", result.MusicBrainz[0].ID)\n    }\n',l+="}\n",`package main\n\n${o}\n\n${l}`},enterprise:function(e,t){const n=m(e,"api_token"),a=m(e,"return"),r=m(e,"accurate_offsets"),s=m(e,"skip"),i=m(e,"every"),o=m(e,"limit"),l=m(e,"skip_first_seconds"),d=m(e,"use_timecode"),u=t?'import (\n    "fmt"\n    "log"\n    "os"\n\n    audd "github.com/AudDMusic/audd-go"\n)':'import (\n    "fmt"\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)';let c="func main() {\n";c+=`    client := audd.NewClient("${n}")\n`,c+="    defer client.Close()\n\n";let p=`"${m(e,"url")}"`;t&&(c+=`    f, err := os.Open("${m(e,"file")}")\n`,c+="    if err != nil {\n        log.Fatal(err)\n    }\n",c+="    defer f.Close()\n\n",p="f");const f=[],g=[];a&&g.push(`        ReturnMetadata: "${a}",`),s&&(f.push(`    skip := ${s}`),g.push("        Skip: &skip,")),i&&(f.push(`    every := ${i}`),g.push("        Every: &every,")),o&&(f.push(`    limit := ${o}`),g.push("        Limit: &limit,")),l&&(f.push(`    skipFirstSeconds := ${l}`),g.push("        SkipFirstSeconds: &skipFirstSeconds,")),"true"!==r&&"false"!==r||(f.push(`    accurate := ${r}`),g.push("        AccurateOffsets: &accurate,")),"true"!==d&&"false"!==d||(f.push(`    useTimecode := ${d}`),g.push("        UseTimecode: &useTimecode,"));const _=h(e,["return","skip","every","limit","skip_first_seconds","use_timecode","accurate_offsets"],"        ");return f.length&&(c+=f.join("\n")+"\n"),0!==g.length||_?(c+=`    matches, err := client.RecognizeEnterprise(${p}, &audd.EnterpriseOptions{\n`,g.length&&(c+=g.join("\n")+"\n"),c+=_,c+="    })\n"):c+=`    matches, err := client.RecognizeEnterprise(${p}, nil)\n`,c+="    if err != nil {\n        log.Fatal(err)\n    }\n",c+="    for _, m := range matches {\n",c+='        fmt.Printf("%s  %s \u2014 %s\\n", m.Timecode, m.Artist, m.Title)\n',c+="    }\n",c+="}\n",`package main\n\n${u}\n\n${c}`},setCallbackUrl:function(e){const t=m(e,"api_token"),n=m(e,"url"),a=m(e,"return"),r=h(e,["return"],"        ");let s="func main() {\n";return s+=`    client := audd.NewClient("${t}")\n`,s+="    defer client.Close()\n\n",a||r?(s+=`    err := client.Streams().SetCallbackUrl("${n}", &audd.SetCallbackUrlOptions{\n`,a&&(s+=`        ReturnMetadata: "${a}",\n`),s+=r,s+="    })\n"):s+=`    err := client.Streams().SetCallbackUrl("${n}", nil)\n`,s+="    if err != nil {\n        log.Fatal(err)\n    }\n",s+="}\n",`package main\n\nimport (\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${s}`},getCallbackUrl:function(e){let t="func main() {\n";return t+=`    client := audd.NewClient("${m(e,"api_token")}")\n`,t+="    defer client.Close()\n\n",t+="    url, err := client.Streams().GetCallbackUrl()\n",t+="    if err != nil {\n        log.Fatal(err)\n    }\n",t+='    fmt.Println("callback URL:", url)\n',t+="}\n",`package main\n\nimport (\n    "fmt"\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${t}`},addStream:function(e){const t=m(e,"api_token"),n=m(e,"url"),a=m(e,"radio_id"),r=m(e,"callbacks");let s="func main() {\n";return s+=`    client := audd.NewClient("${t}")\n`,s+="    defer client.Close()\n\n",s+="    err := client.Streams().Add(audd.AddStreamRequest{\n",s+=`        URL:       "${n}",\n`,s+=`        RadioID:   ${a||"1"},\n`,r&&(s+=`        Callbacks: "${r}",\n`),s+=h(e,["radio_id","callbacks"],"        "),s+="    })\n",s+="    if err != nil {\n        log.Fatal(err)\n    }\n",s+="}\n",`package main\n\nimport (\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${s}`},setStreamUrl:function(e){const t=m(e,"api_token"),n=m(e,"url");let a="func main() {\n";return a+=`    client := audd.NewClient("${t}")\n`,a+="    defer client.Close()\n\n",a+=`    err := client.Streams().SetURL(${m(e,"radio_id")||"1"}, "${n}")\n`,a+="    if err != nil {\n        log.Fatal(err)\n    }\n",a+="}\n",`package main\n\nimport (\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${a}`},deleteStream:function(e){let t="func main() {\n";return t+=`    client := audd.NewClient("${m(e,"api_token")}")\n`,t+="    defer client.Close()\n\n",t+=`    err := client.Streams().Delete(${m(e,"radio_id")||"1"})\n`,t+="    if err != nil {\n        log.Fatal(err)\n    }\n",t+="}\n",`package main\n\nimport (\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${t}`},getStreams:function(e){let t="func main() {\n";return t+=`    client := audd.NewClient("${m(e,"api_token")}")\n`,t+="    defer client.Close()\n\n",t+="    streams, err := client.Streams().List()\n",t+="    if err != nil {\n        log.Fatal(err)\n    }\n",t+="    for _, s := range streams {\n",t+='        fmt.Println(s.RadioID, s.URL, "running:", s.StreamRunning)\n',t+="    }\n",t+="}\n",`package main\n\nimport (\n    "fmt"\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${t}`},upload:function(e,t){const n=m(e,"api_token"),a=m(e,"audio_id"),r=t?'import (\n    "log"\n    "os"\n\n    audd "github.com/AudDMusic/audd-go"\n)':'import (\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)';let s,i="func main() {\n";return i+=`    client := audd.NewClient("${n}")\n`,i+="    defer client.Close()\n\n",t?(i+=`    f, err := os.Open("${m(e,"file")}")\n`,i+="    if err != nil {\n        log.Fatal(err)\n    }\n",i+="    defer f.Close()\n\n",s="f"):s=`"${m(e,"url")}"`,i+=`    if err := client.CustomCatalog().Add(${a||"1"}, ${s}); err != nil {\n`,i+="        log.Fatal(err)\n    }\n",i+="}\n",`package main\n\n${r}\n\n${i}`},findLyrics:function(e){let t="func main() {\n";return t+=`    client := audd.NewClient("${m(e,"api_token")}")\n`,t+="    defer client.Close()\n\n",t+=`    results, err := client.Advanced().FindLyrics("${m(e,"q")}")\n`,t+="    if err != nil {\n        log.Fatal(err)\n    }\n",t+='    if len(results) == 0 {\n        fmt.Println("no lyrics found")\n        return\n    }\n\n',t+="    first := results[0]\n",t+='    fmt.Printf("%s \u2014 %s\\n", first.Artist, first.Title)\n',t+='    fmt.Println("Full title: ", first.FullTitle)\n',t+='    fmt.Println("Media:      ", first.Media)\n',t+='    fmt.Println("Song link:  ", first.SongLink)\n',t+='    fmt.Println("Song ID:    ", first.SongID)\n',t+='    fmt.Println("Artist ID:  ", first.ArtistID)\n',t+="    fmt.Println()\n",t+="    fmt.Println(first.Lyrics)\n",t+="}\n",`package main\n\nimport (\n    "fmt"\n    "log"\n\n    audd "github.com/AudDMusic/audd-go"\n)\n\n${t}`}};function g(e,t,n){const a=function(e){if("https://enterprise.audd.io/"===e)return"enterprise";const t=/^https:\/\/api\.audd\.io\/([a-zA-Z]*)\/?$/.exec(e);return t?t[1]||"recognize":null}(e),r=a&&f[a];return r?r(t,n):function(e,t){return["package main","","import (",'    "fmt"','    "io"','    "net/http"','    "net/url"',")","","func main() {","    data := url.Values{",t.filter(e=>void 0!==e.example).map(e=>`        "${e.name}": {"${e.example}"},`).join("\n"),"    }",`    response, _ := http.PostForm("${e}", data)`,"    defer response.Body.Close()","    body, _ := io.ReadAll(response.Body)","    fmt.Println(string(body))","}"].join("\n")}(e,t)}function _(e,t){return g(e,t,!1)}function y(e,t){return g(e,t,!0)}var k=n(4848);const x=({sdkKey:e,lang:t,sdkOnly:n,fileForm:a})=>{if(!e)return null;const r=a?c[e+"_file"]:null,d=c[e],u=r&&r[t]?r:d;if(!u)return null;const p=u[t];if(!p)return null;const m=i.find(e=>e.value===t),h=m?.codeLang??t,f=m?.label??t,g=l[e];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"With the SDK:"})}),o[t]&&(0,k.jsx)(s.A,{language:o[t].lang,children:o[t].code}),(0,k.jsx)(s.A,{language:h,children:p}),g&&(0,k.jsx)("p",{className:"sdk-example-ref",children:(0,k.jsxs)("a",{href:`/sdks/${t}#${g}`,children:["Full ",f," reference \u2192"]})})]})},v=[{value:"python",label:"Python",hasHttp:!0},{value:"node",label:"Node",hasHttp:!0},{value:"go",label:"Go",hasHttp:!0},{value:"rust",label:"Rust",hasHttp:!1},{value:"php",label:"PHP",hasHttp:!0},{value:"swift",label:"Swift",hasHttp:!1},{value:"kotlin",label:"Kotlin",hasHttp:!1},{value:"dotnet",label:"C#",hasHttp:!1},{value:"java",label:"Java",hasHttp:!0},{value:"c",label:"C",hasHttp:!1},{value:"cpp",label:"C++",hasHttp:!1}],L={python:"python",node:"js",php:"php",java:"java"},w=({children:e,parameters:t,exampleResponse:n,exampleResponseDescription:s,id:i,codeExamples:o,endpoint:l})=>(0,k.jsx)("div",{className:"tabs-section",children:(0,k.jsxs)(a.A,{defaultValue:"request",values:void 0===o?[{label:"Request",value:"request"},{label:"Response",value:"response"}]:[{label:"Request",value:"request"},{label:"Response",value:"response"},{label:"Code examples",value:"code_examples"}],children:[(0,k.jsxs)(r.A,{value:"request",children:[(0,k.jsx)("div",{className:"request-info-title",children:"Form Data Parameters"}),(0,k.jsxs)("div",{className:"request-info-body",children:[t.map(e=>{let t;return t=!0===e.required?(0,k.jsx)("div",{className:"parameter-required-type required",children:"REQUIRED"}):!1===e.required?(0,k.jsx)("div",{className:"parameter-required-type optional",children:"OPTIONAL"}):(0,k.jsx)("div",{className:"parameter-required-type optional",children:"POSSIBLY REQUIRED"}),(0,k.jsxs)("div",{children:[(0,k.jsxs)("div",{className:"parameter-name",children:[e.name," ",t]})," ",(0,k.jsx)("div",{className:"parameter-type",children:(0,k.jsx)("code",{children:e.type})}),(0,k.jsx)("div",{className:"parameter-description",children:e.description})]},e.name)})," "]})]}),(0,k.jsxs)(r.A,{value:"response",children:[(0,k.jsx)("div",{className:"request-info-title",children:s}),(0,k.jsxs)("div",{className:"request-info-body",children:[(0,k.jsxs)("div",{className:"http-code",children:[(0,k.jsx)("span",{className:"http-code-dot-success"}),(0,k.jsx)("span",{className:"http-code-status",children:"200: OK"})]})," ",(0,k.jsx)(b,{exampleResponse:n,id:i})]})]}),void 0!==o&&(0,k.jsx)(r.A,{value:"code_examples",children:(0,k.jsx)(A,{parameters:t,endpoint:l})})]})}),b=({children:e,exampleResponse:t,id:n})=>{var a,r=JSON.stringify(t,null,"  ");return a=(0,k.jsx)(s.A,{className:"javascript",language:"javascript",children:r}),a=r.length>2e3?(0,k.jsx)("div",{style:{fontSize:"12px",height:"500px",overflowY:"scroll"},children:a}):(0,k.jsx)("div",{style:{fontSize:"14px"},children:a})},A=({children:e,parameters:t,endpoint:n})=>(0,k.jsx)(D,{children:e,parameters:t,endpoint:n}),D=({children:e,parameters:t,endpoint:n})=>{for(var s=!1,i=0;i<t.length;i++)if("binary"==t[i].type){s=!0;break}return s?(0,k.jsxs)(a.A,{defaultValue:"by_url",values:[{label:"Send a file URL",value:"by_url"},{label:"Send a local file",value:"by_file"}],children:[(0,k.jsx)(r.A,{value:"by_url",children:(0,k.jsx)(j,{endpoint:n,parameters:t.filter(e=>void 0!==e.example&&"binary"!=e.type)})}),(0,k.jsx)(r.A,{value:"by_file",children:(0,k.jsx)(C,{endpoint:n,parameters:t.filter(e=>void 0!==e.example&&"url"!=e.name)})})]}):(0,k.jsx)(j,{endpoint:n,parameters:t})},j=({children:e,parameters:t,endpoint:n})=>{t=t.filter(e=>void 0!==e.example);const i=u(n),d="curl "+n+t.map(e=>" \\\n    -F "+e.name+"='"+e.example+"'").join(""),c={python:"import requests\ndata = {\n"+t.map(e=>
1"    '"+e.name+"': '"+e.example+"',").join("\n")+"\n}\nresult = requests.post('"+n+"', data=data)\nprint(result.text)",node:'var axios = require("axios");\n\nvar data = {\n'+t.map(e=>"    '"+e.name+"': '"+e.example+"',").join("\n")+"\n};\n\naxios({\n    method: 'post',\n    url: '"+n+"',\n    data: data,\n    headers: { 'Content-Type': 'multipart/form-data' },\n})\n.then((response) => {\n    console.log(response);\n})\n.catch((error) =>  {\n    console.log(error);\n});",php:"<?php\n$data = [\n"+t.map(e=>"    '"+e.name+"' => '"+e.example+"',").join("\n")+"\n];\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_URL, '"+n+"');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n$result = curl_exec($ch);\ncurl_close($ch);\necho $result;",java:"// requires OkHttp\nOkHttpClient client = new OkHttpClient();\nRequestBody data = new MultipartBody.Builder().setType(MultipartBody.FORM)\n"+t.map(e=>'    .addFormDataPart("'+e.name+'", "'+e.example+'")').join("\n")+'.build();\nRequest request = new Request.Builder().url("'+n+'")\n    .post(data).build();\nResponse response = client.newCall(request).execute();\nSystem.out.println(response.body().string());'},p=[...v.map(e=>({label:e.label,value:e.value})),{label:"curl",value:"curl"}];return(0,k.jsx)("div",{className:"tabs-section",children:(0,k.jsxs)(a.A,{groupId:"sdk-language",defaultValue:"python",values:p,children:[(0,k.jsxs)(r.A,{value:"curl",children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"Plain HTTP, no SDK:"})}),(0,k.jsx)(s.A,{className:"bash",language:"bash",children:d})]},"curl"),v.map(e=>(0,k.jsxs)(r.A,{value:e.value,children:["go"===e.value&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"With the SDK:"})}),o.go&&(0,k.jsx)(s.A,{language:o.go.lang,children:o.go.code}),(0,k.jsx)(s.A,{className:"go",language:"go",children:_(n,t)}),l[i]&&(0,k.jsx)("p",{className:"sdk-example-ref",children:(0,k.jsx)("a",{href:`/sdks/go#${l[i]}`,children:"Full Go SDK reference \u2192"})})]}),"go"!==e.value&&(0,k.jsx)(x,{sdkKey:i,lang:e.value}),"go"!==e.value&&e.hasHttp&&c[e.value]&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"Or send the request yourself, without the SDK:"})}),(0,k.jsx)(s.A,{language:L[e.value]??e.value,children:c[e.value]})]})]},e.value))]})})},C=({children:e,parameters:t,endpoint:n})=>{t=t.filter(e=>void 0!==e.example);const i=u(n),d="curl "+n+t.map(e=>"binary"==e.type?" \\ \n    -F "+e.name+"=@"+e.example:" \\\n    -F "+e.name+"='"+e.example+"'").join(""),c={python:"import requests\ndata = {\n"+t.filter(e=>"binary"!=e.type).map(e=>"    '"+e.name+"': '"+e.example+"',").join("\n")+"\n}\nfiles = {\n"+t.filter(e=>"binary"==e.type).map(e=>"    '"+e.name+"': open('"+e.example+"', 'rb'),").join("\n")+"\n}\nresult = requests.post('"+n+"', data=data, files=files)\nprint(result.text)",node:"var axios = require(\"axios\");\nvar fs = require('fs');\n\nvar data = {\n"+t.map(e=>"binary"==e.type?"    '"+e.name+"': fs.createReadStream('"+e.example+"'),":"    '"+e.name+"': '"+e.example+"',").join("\n")+"\n};\n\naxios({\n    method: 'post',\n    url: '"+n+"',\n    data: data,\n    headers: { 'Content-Type': 'multipart/form-data' },\n})\n.then((response) => {\n    console.log(response);\n})\n.catch((error) =>  {\n    console.log(error);\n});",php:"<?php\n$data = [\n"+t.map(e=>"binary"==e.type?"    '"+e.name+"' => curl_file_create('"+e.example+"', \n        'application/octet-stream', 'file'),":"    '"+e.name+"' => '"+e.example+"',").join("\n")+"\n];\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_URL, '"+n+"');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n$result = curl_exec($ch);\ncurl_close($ch);\necho $result;",java:'// requires OkHttp\nfinal MediaType MEDIA_TYPE_MP3 = MediaType.get("audio/mpeg; charset=utf-8");\n'+t.filter(e=>"binary"==e.type).map(e=>"File "+e.name+' = new File("'+e.example+'");').join("\n")+"\nOkHttpClient client = new OkHttpClient();\nRequestBody data = new MultipartBody.Builder().setType(MultipartBody.FORM)\n"+t.map(e=>"binary"==e.type?'    .addFormDataPart("'+e.name+'", '+e.name+".getName(), \n        RequestBody.Companion.create("+e.name+", MEDIA_TYPE_MP3))":'    .addFormDataPart("'+e.name+'", "'+e.example+'")').join("\n")+'.build();\nRequest request = new Request.Builder().url("'+n+'")\n    .post(data).build();\nResponse response = client.newCall(request).execute();\nSystem.out.println(response.body().string());'},p=[...v.map(e=>({label:e.label,value:e.value})),{label:"curl",value:"curl"}];return(0,k.jsx)("div",{className:"tabs-section",children:(0,k.jsxs)(a.A,{groupId:"sdk-language",defaultValue:"python",values:p,children:[(0,k.jsxs)(r.A,{value:"curl",children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"Plain HTTP, no SDK:"})}),(0,k.jsx)(s.A,{className:"bash",language:"bash",children:d})]},"curl"),v.map(e=>(0,k.jsxs)(r.A,{value:e.value,children:["go"===e.value&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"With the SDK:"})}),o.go&&(0,k.jsx)(s.A,{language:o.go.lang,children:o.go.code}),(0,k.jsx)(s.A,{className:"go",language:"go",children:y(n,t)}),l[i]&&(0,k.jsx)("p",{className:"sdk-example-ref",children:(0,k.jsx)("a",{href:`/sdks/go#${l[i]}`,children:"Full Go SDK reference \u2192"})})]}),"go"!==e.value&&(0,k.jsx)(x,{sdkKey:i,lang:e.value,fileForm:!0}),"go"!==e.value&&e.hasHttp&&c[e.value]&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"sdk-example-lead",children:(0,k.jsx)("strong",{children:"Or send the request yourself, without the SDK:"})}),(0,k.jsx)(s.A,{language:L[e.value]??e.value,children:c[e.value]})]})]},e.value))]})})},$=({children:e,color:t,type:n})=>(0,k.jsx)("div",{style:{margin:0,display:"inline-block",padding:"0",paddingRight:"4px"},children:(0,k.jsx)("div",{style:{color:"#FFFFFF",margin:0,display:"inline-flex",padding:"3px 0px",background:"#3884FF",alignItems:"center",borderRadius:"9999px",WebkitBoxAlign:"center",backgroundColor:t},children:(0,k.jsx)("span",{style:{padding:"0px 12px",alignItems:"center",fontSize:"calc(0.75 * var(--ifm-h2-font-size))",fontWeight:500,lineHeight:"calc(0.9 * var(--ifm-h2-font-size))",textTransform:"uppercase"},children:n})})})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.