how can I use google product search api?

272 views Asked by At

I'm a beginner of programming and I have little experience in Python, but it's basic level.

I'm trying to make web application using Google cloud vision product search API.

I tried to follow how-to-guides on google, but I totally can't understand Creating a product set section.

First I tried to use codes in python category, but I can't understand how it works.

It also shows command like

HTTP method and URL:

POST https://vision.googleapis.com/v1/projects/project-id/locations/location-id/productSets

Request JSON body:

{
  "displayName": "display-name"
}

I tried this in Cloud Shell, but it doesn't work.

I don't know where and how to input those command at all.

Please answer how to use those commands. Thank you.

1

There are 1 answers

0
Brendan On

You can try an example like this (replace with your project and desired location)

curl -s -d "{ display_name: 'your display name' }" "https://vision.googleapis.com/v1/projects/your_project/locations/us-west1/productSets?product_set_id=your_set_id" -H "Content-Type: application/json" -H "Authorization: Bearer $(gcloud auth print-access-token)";