Initialize

Training Set and Classifier


getGenre function

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

Create API

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

Deploy API to Wolfram Cloud

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