import{S as la,i as ia,s as na,e as o,k as n,w as be,t as l,M as fa,c as r,d as a,m as f,a as s,x as Ae,h as i,b as c,G as t,g as d,y as $e,L as ha,q as Pe,o as ye,B as De,v as ca}from"../chunks/vendor-hf-doc-builder.js";import{I as sa}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as da}from"../chunks/CodeBlock-hf-doc-builder.js";function pa(Ie){let E,dt,m,$,Q,I,Dt,J,It,pt,L,Rt,ut,R,vt,C,kt,Et,P,z,_,F,Gt,St,K,xt,Ot,V,Lt,Ct,g,w,W,Ht,Bt,X,jt,Nt,H,Z,Ut,qt,Mt,T,tt,Yt,Qt,et,Jt,zt,p,Ft,at,Kt,Vt,Wt,Xt,ot,Zt,te,ee,ae,rt,oe,re,se,b,st,le,ie,lt,ne,fe,mt,_t,A,y,it,k,he,nt,ce,gt,D,de,G,pe,ue,wt,B,ve,Tt,v,ft,S,Ee,me,ht,x,_e,ge,ct,O,we,bt;return I=new sa({}),R=new da({props:{code:"https://datasets-server.huggingface.co",highlighted:'https:<span class="hljs-regexp">//</span>datasets-server.huggingface.co'}}),k=new sa({}),{c(){E=o("meta"),dt=n(),m=o("h1"),$=o("a"),Q=o("span"),be(I.$$.fragment),Dt=n(),J=o("span"),It=l("API reference"),pt=n(),L=o("p"),Rt=l("The base URL of the REST API is"),ut=n(),be(R.$$.fragment),vt=n(),C=o("p"),kt=l("It provides the following endpoints:"),Et=n(),P=o("table"),z=o("thead"),_=o("tr"),F=o("th"),Gt=l("Endpoint"),St=n(),K=o("th"),xt=l("Description"),Ot=n(),V=o("th"),Lt=l("Query parameters"),Ct=n(),g=o("tbody"),w=o("tr"),W=o("td"),Ht=l("/splits GET"),Bt=n(),X=o("td"),jt=l("Get the list of configurations and splits of a dataset."),Nt=n(),H=o("td"),Z=o("code"),Ut=l("dataset"),qt=l(": name of the dataset"),Mt=n(),T=o("tr"),tt=o("td"),Yt=l("/first-rows GET"),Qt=n(),et=o("td"),Jt=l("Get the first rows of a dataset split."),zt=n(),p=o("td"),Ft=l("- "),at=o("code"),Kt=l("dataset"),Vt=l(": name of the dataset"),Wt=o("br"),Xt=l("- "),ot=o("code"),Zt=l("config"),te=l(": name of the config"),ee=o("br"),ae=l("- "),rt=o("code"),oe=l("split"),re=l(": name of the split"),se=n(),b=o("tr"),st=o("td"),le=l("/valid GET"),ie=n(),lt=o("td"),ne=l("Get the list of datasets hosted in the Hub and supported by the datasets server."),fe=n(),mt=o("td"),_t=n(),A=o("h2"),y=o("a"),it=o("span"),be(k.$$.fragment),he=n(),nt=o("span"),ce=l("OpenAPI specification"),gt=n(),D=o("p"),de=l("The OpenAPI (fka Swagger) specification is published at "),G=o("a"),pe=l("https://datasets-server.huggingface.co/openapi.json"),ue=l("."),wt=n(),B=o("p"),ve=l("You can explore it with:"),Tt=n(),v=o("ul"),ft=o("li"),S=o("a"),Ee=l("ReDoc"),me=n(),ht=o("li"),x=o("a"),_e=l("Postman"),ge=n(),ct=o("li"),O=o("a"),we=l("RapidAPI"),this.h()},l(e){const h=fa('[data-svelte="svelte-1phssyn"]',document.head);E=r(h,"META",{name:!0,content:!0}),h.forEach(a),dt=f(e),m=r(e,"H1",{class:!0});var At=s(m);$=r(At,"A",{id:!0,class:!0,href:!0});var Re=s($);Q=r(Re,"SPAN",{});var ke=s(Q);Ae(I.$$.fragment,ke),ke.forEach(a),Re.forEach(a),Dt=f(At),J=r(At,"SPAN",{});var Ge=s(J);It=i(Ge,"API reference"),Ge.forEach(a),At.forEach(a),pt=f(e),L=r(e,"P",{});var Se=s(L);Rt=i(Se,"The base URL of the REST API is"),Se.forEach(a),ut=f(e),Ae(R.$$.fragment,e),vt=f(e),C=r(e,"P",{});var xe=s(C);kt=i(xe,"It provides the following endpoints:"),xe.forEach(a),Et=f(e),P=r(e,"TABLE",{});var $t=s(P);z=r($t,"THEAD",{});var Oe=s(z);_=r(Oe,"TR",{});var j=s(_);F=r(j,"TH",{});var Le=s(F);Gt=i(Le,"Endpoint"),Le.forEach(a),St=f(j),K=r(j,"TH",{});var Ce=s(K);xt=i(Ce,"Description"),Ce.forEach(a),Ot=f(j),V=r(j,"TH",{});var He=s(V);Lt=i(He,"Query parameters"),He.forEach(a),j.forEach(a),Oe.forEach(a),Ct=f($t),g=r($t,"TBODY",{});var N=s(g);w=r(N,"TR",{});var U=s(w);W=r(U,"TD",{});var Be=s(W);Ht=i(Be,"/splits GET"),Be.forEach(a),Bt=f(U),X=r(U,"TD",{});var je=s(X);jt=i(je,"Get the list of configurations and splits of a dataset."),je.forEach(a),Nt=f(U),H=r(U,"TD",{});var Te=s(H);Z=r(Te,"CODE",{});var Ne=s(Z);Ut=i(Ne,"dataset"),Ne.forEach(a),qt=i(Te,": name of the dataset"),Te.forEach(a),U.forEach(a),Mt=f(N),T=r(N,"TR",{});var q=s(T);tt=r(q,"TD",{});var Ue=s(tt);Yt=i(Ue,"/first-rows GET"),Ue.forEach(a),Qt=f(q),et=r(q,"TD",{});var qe=s(et);Jt=i(qe,"Get the first rows of a dataset split."),qe.forEach(a),zt=f(q),p=r(q,"TD",{});var u=s(p);Ft=i(u,"- "),at=r(u,"CODE",{});var Me=s(at);Kt=i(Me,"dataset"),Me.forEach(a),Vt=i(u,": name of the dataset"),Wt=r(u,"BR",{}),Xt=i(u,"- "),ot=r(u,"CODE",{});var Ye=s(ot);Zt=i(Ye,"config"),Ye.forEach(a),te=i(u,": name of the config"),ee=r(u,"BR",{}),ae=i(u,"- "),rt=r(u,"CODE",{});var Qe=s(rt);oe=i(Qe,"split"),Qe.forEach(a),re=i(u,": name of the split"),u.forEach(a),q.forEach(a),se=f(N),b=r(N,"TR",{});var M=s(b);st=r(M,"TD",{});var Je=s(st);le=i(Je,"/valid GET"),Je.forEach(a),ie=f(M),lt=r(M,"TD",{});var ze=s(lt);ne=i(ze,"Get the list of datasets hosted in the Hub and supported by the datasets server."),ze.forEach(a),fe=f(M),mt=r(M,"TD",{}),s(mt).forEach(a),M.forEach(a),N.forEach(a),$t.forEach(a),_t=f(e),A=r(e,"H2",{class:!0});var Pt=s(A);y=r(Pt,"A",{id:!0,class:!0,href:!0});var Fe=s(y);it=r(Fe,"SPAN",{});var Ke=s(it);Ae(k.$$.fragment,Ke),Ke.forEach(a),Fe.forEach(a),he=f(Pt),nt=r(Pt,"SPAN",{});var Ve=s(nt);ce=i(Ve,"OpenAPI specification"),Ve.forEach(a),Pt.forEach(a),gt=f(e),D=r(e,"P",{});var yt=s(D);de=i(yt,"The OpenAPI (fka Swagger) specification is published at "),G=r(yt,"A",{href:!0,rel:!0});var We=s(G);pe=i(We,"https://datasets-server.huggingface.co/openapi.json"),We.forEach(a),ue=i(yt,"."),yt.forEach(a),wt=f(e),B=r(e,"P",{});var Xe=s(B);ve=i(Xe,"You can explore it with:"),Xe.forEach(a),Tt=f(e),v=r(e,"UL",{});var Y=s(v);ft=r(Y,"LI",{});var Ze=s(ft);S=r(Ze,"A",{href:!0,rel:!0});var ta=s(S);Ee=i(ta,"ReDoc"),ta.forEach(a),Ze.forEach(a),me=f(Y),ht=r(Y,"LI",{});var ea=s(ht);x=r(ea,"A",{href:!0,rel:!0});var aa=s(x);_e=i(aa,"Postman"),aa.forEach(a),ea.forEach(a),ge=f(Y),ct=r(Y,"LI",{});var oa=s(ct);O=r(oa,"A",{href:!0,rel:!0});var ra=s(O);we=i(ra,"RapidAPI"),ra.forEach(a),oa.forEach(a),Y.forEach(a),this.h()},h(){c(E,"name","hf:doc:metadata"),c(E,"content",JSON.stringify(ua)),c($,"id","api-reference"),c($,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c($,"href","#api-reference"),c(m,"class","relative group"),c(y,"id","openapi-specification"),c(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(y,"href","#openapi-specification"),c(A,"class","relative group"),c(G,"href","https://datasets-server.huggingface.co/openapi.json"),c(G,"rel","nofollow"),c(S,"href","https://redocly.github.io/redoc/?url=https://datasets-server.huggingface.co/openapi.json"),c(S,"rel","nofollow"),c(x,"href","https://www.postman.com/huggingface/workspace/hugging-face-apis/documentation/23242779-d068584e-96d1-4d92-a703-7cb12cbd8053"),c(x,"rel","nofollow"),c(O,"href","https://rapidapi.com/hugging-face-hugging-face-default/api/hugging-face-datasets-api/"),c(O,"rel","nofollow")},m(e,h){t(document.head,E),d(e,dt,h),d(e,m,h),t(m,$),t($,Q),$e(I,Q,null),t(m,Dt),t(m,J),t(J,It),d(e,pt,h),d(e,L,h),t(L,Rt),d(e,ut,h),$e(R,e,h),d(e,vt,h),d(e,C,h),t(C,kt),d(e,Et,h),d(e,P,h),t(P,z),t(z,_),t(_,F),t(F,Gt),t(_,St),t(_,K),t(K,xt),t(_,Ot),t(_,V),t(V,Lt),t(P,Ct),t(P,g),t(g,w),t(w,W),t(W,Ht),t(w,Bt),t(w,X),t(X,jt),t(w,Nt),t(w,H),t(H,Z),t(Z,Ut),t(H,qt),t(g,Mt),t(g,T),t(T,tt),t(tt,Yt),t(T,Qt),t(T,et),t(et,Jt),t(T,zt),t(T,p),t(p,Ft),t(p,at),t(at,Kt),t(p,Vt),t(p,Wt),t(p,Xt),t(p,ot),t(ot,Zt),t(p,te),t(p,ee),t(p,ae),t(p,rt),t(rt,oe),t(p,re),t(g,se),t(g,b),t(b,st),t(st,le),t(b,ie),t(b,lt),t(lt,ne),t(b,fe),t(b,mt),d(e,_t,h),d(e,A,h),t(A,y),t(y,it),$e(k,it,null),t(A,he),t(A,nt),t(nt,ce),d(e,gt,h),d(e,D,h),t(D,de),t(D,G),t(G,pe),t(D,ue),d(e,wt,h),d(e,B,h),t(B,ve),d(e,Tt,h),d(e,v,h),t(v,ft),t(ft,S),t(S,Ee),t(v,me),t(v,ht),t(ht,x),t(x,_e),t(v,ge),t(v,ct),t(ct,O),t(O,we),bt=!0},p:ha,i(e){bt||(Pe(I.$$.fragment,e),Pe(R.$$.fragment,e),Pe(k.$$.fragment,e),bt=!0)},o(e){ye(I.$$.fragment,e),ye(R.$$.fragment,e),ye(k.$$.fragment,e),bt=!1},d(e){a(E),e&&a(dt),e&&a(m),De(I),e&&a(pt),e&&a(L),e&&a(ut),De(R,e),e&&a(vt),e&&a(C),e&&a(Et),e&&a(P),e&&a(_t),e&&a(A),De(k),e&&a(gt),e&&a(D),e&&a(wt),e&&a(B),e&&a(Tt),e&&a(v)}}}const ua={local:"api-reference",sections:[{local:"openapi-specification",title:"OpenAPI specification"}],title:"API reference"};function va(Ie){return ca(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ga extends la{constructor(E){super();ia(this,E,va,pa,na,{})}}export{ga as default,ua as metadata};
