How should i call webflow cms api to get a particular record on javascript

How should i call webflow cms api to get a particular record on javascript.
I have tried jquery, xhr and fetch. I got Cors policy error while using these approch.

You can’t call the API directly from client-side JS.
You need to build a middle tier, where you have a piece of server-side code that retrieves the data.
Typically you can build this as a serverless function or even using an automation platform like Make if you wanted to.

Note - retrieving the data directly from the API is problematic due to;

  • rate limits, if your site gets any substantial traffic, it will fail
  • calls require a CMS item ID, you can’t query or retrieve by slug

You might do better to use a tool like Whalesync to sync the CMS content to an external store like Airtable which you can write your functions against with more flexibility.