xquery version "3.1";

declare function local:lookup-word($word as xs:string, $id as xs:string, $key as xs:string) {
  let $request :=
    <http:request href="https://od-api.oxforddictionaries.com/api/v1/wordlist/en/registers=Rare;domains=Art"  method="get">
      <http:header name="app_key" value="{$key}"/>
      <http:header name="app_id" value="{$id}"/>
    </http:request>
  return http:send-request($request)
};

let $word := "person"
let $id := "###"
let $key := "###"
let $lookup-word := local:lookup-word(?, $id, $key)
return $lookup-word("person")