Using the API Endpoint

You can make requests to the TakeShape GraphQL API from your project endpoint:[project-id]/graphql

You can find your project's ID in its URL. When inside your project, the ID follows after

You can find and copy your project's API endpoint from the Setup and API Keys pages of your project.

Your request should include the API key you created as a Bearer Token. 

For a simple request using fetch set the body of the request as the GraphQL query.

const query = `
    getBookList {
        items {

fetch('[PROJECT-ID]/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer [GENERATED-API-KEY]'
  body: JSON.stringify({query})
}).then(res => {
  return res.json();
}).then(json => {

The response will look like this:

    "data": {
        "getBookList": {
            "items": [
                    "title": "Peter Pan"
                    "title": "The Lion, the Witch, and the Wardrobe"
                    "title": "Treasure Island"
                    "title": "Alice in Wonderland"

Rate Limits and 429 Errors

If you receive a 429 error you are bumping into a rate limit. 429 means "Too Many Requests". You can use the following HTTP response headers to tune requests to the API.

X-RateLimit-Limit: NNN
X-RateLimit-Remaining: NNN
X-RateLimit-Reset: NNN

X-RateLimit-Limit - How many API requests you can make per second. Your limit is measured over a 60 second window. 

X-RateLimit-Remaining - How many API requests are remaining in the window.

 X-RateLimit-Reset - When the rate limit window resets.

Join us

Interested in joining the team as coworker or investor?