---
title: Full API Docs with Swagger/OpenAPI
slug: docs/demo/full-api-docs-with-swaggeropenapi
description: This document offers code examples in multiple programming languages to retrieve cake information from the "Get Cakes" API endpoint. Discover code snippets in curl, Go, JavaScript, Node.js, Python, and Ruby. Learn how the API response includes either a 20
icon: ☁️
docTags: 
createdAt: 2019-08-06T08:09:03.000Z
---

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.cakes.com",
  "name": "Get Cakes",
  "method": "GET",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "optional",
        "name": "Parameter name",
        "type": "String",
        "description": ""
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "id",
        "type": "string",
        "description": "ID of the cake to get"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "nKCs8owTvyPc5AV5Sli0q",
        "code": "{\n    \"name\": \"Cake's name\",\n    \"recipe\": \"Cake's recipe name\",\n    \"cake\": \"Binary cake\"\n}",
        "language": "202"
      },
      {
        "id": "SaobXYdZq8MqtUZe9OUDM",
        "code": "{\n    \"message\": \"Ain't no cake like that.\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "nKCs8owTvyPc5AV5Sli0q"
  },
  "examples": {
    "languages": [
      {
        "id": "PhCH99TSHs0VnaC2G-7aJ",
        "code": "curl --request GET\n  --url https://api.cakes.com/v1/cakes/:id \n  --header 'Accept: application/json'",
        "language": "curl"
      },
      {
        "id": "VRjNRk5HkGfjhMzpQxK94",
        "code": "",
        "language": "go"
      },
      {
        "id": "ovGmUdPLEnqmhYKwldgK2",
        "code": "fetch(\"https://api.cakes.com/v1/cakes/:id\", {\n  \"method\": \"GET\",\n  \"headers\": {\n    \"Accept\": \"application/json\"\n  }\n})\n.then(response => {\n  console.log(response);\n})\n.catch(err => {\n  console.error(err);\n});",
        "language": "javascript"
      },
      {
        "id": "YDmNpm52VSdIGmF9vR_F2",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {\n  method: 'GET', \nheaders: {\n    Accept: 'application/json',\n  }\n};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "nodejs"
      },
      {
        "id": "jWS3VK8Qu1VzjgPDx6t8q",
        "code": "import requests\n\nurl = \"https://api.cakes.com/v1/cakes/:id\"\nheaders = {\"Accept\": \"application/json\"}\nresponse = requests.request(\"GET\", url, headers=headers)\nprint(response.text)",
        "language": "python"
      },
      {
        "id": "VjYcRe_meprtoFOEZ7QeS",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://api.cakes.com/v1/cakes/:id';\nlet options = {method: 'GET', headers: {Accept: 'application/json'}};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "ruby"
      }
    ],
    "selectedLanguageId": "PhCH99TSHs0VnaC2G-7aJ"
  },
  "responses": [
    {
      "statusCode": "202",
      "description": "Cake successfully retrieved.",
      "jsonExample": "{\n    \"name\": \"Cake's name\",\n    \"recipe\": \"Cake's recipe name\",\n    \"cake\": \"Binary cake\"\n}"
    },
    {
      "statusCode": "404",
      "description": "Could not find a cake matching this query.",
      "jsonExample": "{\n    \"message\": \"Ain't no cake like that.\"\n}"
    }
  ],
  "description": "Get a cake by its ID",
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "get-cakes",
  "legacyHash": "xBBIc3a37XMPEK4WV8__G"
}
```
:::

## Environments&#x20;

### Dev

### Qa

### Live

## Throttling

## Cost per 1000 calls

[Realtime Editor with Markdown Shortcuts!](docId\:x_04MEQiLWW4yMHOOMc80)&#x20;

[Sharing Lambda Layers](docId:4UJrxmSxdWgTEd9zWyMWQ)&#x20;

[Changelogs and Callouts](docId:-s8TpoG43TvvdbuZEXoLH)&#x20;

[Changelogs](docId:6PlTlcJH3q6HLS8oG4efx)&#x20;

[Full API Docs with Swagger/OpenAPI](docId\:w0OoEl1oHiEkrHuZQ3FDv)&#x20;

##

##

