Back

Version 1

3/8/2023
export getLocationEntities = async (text) => {
const URL = `https://language.googleapis.com/v1beta2/documents:analyzeEntities?key=${@me.secrets.googleAPIKey}`;
const bodyText = {
document: {
content: text,
boilerplateHanlding: "BOILERPLATE_HANDLING_UNSPECIFIED",
language: "en",
type: "PLAIN_TEXT",
},
};

let response = await fetch(URL, {
headers: {
"Content-Type": "application/json",
},
body: bodyText,
});
console.log(await response.status);
};
Updated: October 23, 2023