Initialize

Training Set and Classifier


getGenre function

In[]:=
getGenre[keyword_]:=c[keyword]

Create API

In[]:=
api=APIFunction[​​{"keyword""String""study"},​​getGenre[#keyword]&,​​"JSON"​​];​​api
Out[]=
APIFunction[{keywordStringstudy},getGenre[#keyword]&,JSON]

Deploy API to Wolfram Cloud

Note: append ?keyword=[keyword] to the end of the URL
In[]:=
ClearAll[cd];​​cd=CloudDeploy[​​api,​​"/get-genre/",​​Permissions"Public"​​]
Out[]=
CloudObject[
https://www.wolframcloud.com/obj/tmenezes/get-genre
]
In[]:=
api[<|"keyword""break"|>]
Out[]=
chill
In[]:=
api[]
Out[]=
chill