0

I'm pretty new to the google vision api and I am trying to make a TEXT_DETECTION request.

Currently I am reading from an image file, encoding it to base64 and trying to pass it on to the request

const endPoint =`https://vision.googleapis.com/v1/images:annotate?key=${config.api_key}`;

fetch(endPoint, {
  method: "POST",
  body: JSON.stringify({
    requests: [
      {
        image: {
          content: data
        },
        features: [
          {
            type: "TEXT_DETECTION"
          }
        ],
        imageContext: {
          langaugeHints: ["en"]
        }
      }
    ]
  })
})

But I am getting a 400 error. Could anyone spot the error in the code?.

abhiwan
  • 11
  • 3

1 Answers1

1

Found the typo at langaugeHints.

abhiwan
  • 11
  • 3