> ## Documentation Index
> Fetch the complete documentation index at: https://docs-test.rye.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick start

> Get your API key and send your first Rye API request!

<Note>
  For a live production example of creating an order using the Rye SDK in TypeScript, check out our [Order from Amazon in TypeScript](/order-from-amazon-typescript) guide.
</Note>

<Steps>
  <Step title="Grab your API Key">
    To make requests to the Rye GraphQL API, you will need to get an API access key by signing up on the Rye console. To do so:

    1. Navigate, and log in to [https://staging.console.rye.com](https://staging.console.rye.com)
    2. Under Access and Security, view and copy your API key

           <img src="https://mintcdn.com/rye-35/j7SfJ8CcimgGEE8U/images/d883882-image.png?fit=max&auto=format&n=j7SfJ8CcimgGEE8U&q=85&s=e155928c3d2ee9c3f0770967e04d9a08" alt="Grab the API header from console" width="802" height="418" data-path="images/d883882-image.png" />

    Grab the API header from console

    Find out more about [authorizations](api-reference/authorization) needed to use Rye.
  </Step>

  <Step title="Install a GraphQL library">
    Rye APIs are exposed via [GraphQL](/get-started/intro-to-graphql). While it is possible to make requests to Rye using any HTTP client, we recommend using a dedicated GraphQL client library for ease of use. This tutorial will use the [`graphql-request`](https://www.npmjs.com/package/graphql-request) library as it is lightweight and easy to use. You can install it using any Node.js package manager:

    <CodeGroup>
      ```bash npm theme={null}
      npm install graphql-request
      ```

      ```bash yarn theme={null}
      yarn add graphql-request
      ```

      ```bash pnpm theme={null}
      pnpm add graphql-request
      ```
    </CodeGroup>
  </Step>

  <Step title="Initialize a GraphQL client">
    Initialize a GraphQL client with [your API key](/authorization-headers) via the following recipe:

    ```javascript theme={null}
    import { GraphQLClient, gql } from 'graphql-request';

    const endpoint = 'https://staging.graphql.api.rye.com/v1/query';
    const client = new GraphQLClient(endpoint)
    const headers = {
      'Authorization': 'Basic <API Key Here>',
      'Rye-Shopper-IP': '127.0.0.1',
    };
    ```

    <Note>
      For a real integration, the `Rye-Shopper-IP` header should be set to the IP address of the shopper making the request. This is important for fraud detection and prevention.
    </Note>
  </Step>

  <Step title="Making your first GraphQL request">
    Here is an example of fetching some products via GraphQL using the client we just set up.

    <CodeGroup>
      ```javascript Shopify theme={null}
      async function fetchProduct() {
        const query = gql`
          query DemoShopifyProductFetch($input: ProductByIDInput!) {
            product: productByID(input: $input) {
              title
              vendor
              url
              isAvailable
              images {
                url
              }
              price {
                displayValue
              }
              ... on ShopifyProduct {
                productType
              }
            }
          }
        `;

        const variables = {
          input: {
            id: '7074033139917',
            marketplace: 'SHOPIFY',
          },
        };

        const data = await client.request(query, variables, headers);
        console.log(JSON.stringify(data, undefined, 2));
      }

      await fetchProduct();
      ```

      ```javascript Amazon theme={null}
      async function fetchProduct() {
        const query = gql`
          query DemoAmazonProductFetch($input: ProductByIDInput!) {
            product: productByID(input: $input) {
              title
              vendor
              url
              isAvailable
              images {
                url
              }
              price {
                displayValue
              }
              ... on AmazonProduct {
                ASIN
              }
            }
          }
        `;

        const variables = {
          input: {
            id: 'B09H6T8LTR',
            marketplace: 'AMAZON',
          },
        };

        const data = await client.request(query, variables, headers);
        console.log(JSON.stringify(data, undefined, 2));
      }

      await fetchProduct();
      ```
    </CodeGroup>
  </Step>

  <Step title="Explore the rest of the API">
    Explore the entire API offering live on the [Rye Console](https://staging.console.rye.com/). Take a glance through the remaining docs to figure out how the Rye API can integrate into your app!
  </Step>
</Steps>
