The [Storefront API](/docs/api/storefront) lets you build custom storefronts with any language and technology. It provides public access using GraphQL to products, collections, customers, carts, checkouts, and other store resources that you can use to build custom purchasing experiences. After you've [requested access tokens](/docs/storefronts/headless/building-with-the-storefront-api/getting-started) for your app and generated a Storefront API access token, you can make queries using the Storefront API.
## What you'll learn
After you've finished this tutorial, you'll have accomplished the following:
- Requested public, unauthenticated Storefront API access scopes for your app
- Generated a Storefront API access token
- Queried products and collections
> Tip:
> If you're a [Shopify Partner](https://help.shopify.com/en/partners/about), then you can create a [development store](/docs/api/development-stores) to test Storefront API queries.
## Requirements
- You've completed the [Getting started with the Storefront API](/docs/storefronts/headless/building-with-the-storefront-api/getting-started) guide.
- If instead of completing the [Getting started](/docs/storefronts/headless/building-with-the-storefront-api/getting-started), you've created [a public or custom app](/docs/apps/launch/distribution) with Storefront API access enabled in the **Configuration** page. If you've created a public app, then you need to [turn your app into a sales channel](/docs/apps/build/sales-channels/start-building#step-2-turn-an-app-into-a-sales-channel-app).
- You've created [products](/docs/api/admin-graphql/latest/objects/product), [product variants](/docs/api/admin-graphql/latest/objects/productvariant), and [collections](/docs/api/admin-graphql/latest/objects/collection) in your store.
## Query products
You can use the [`products`](/docs/api/storefront/latest/queries/products) query to retrieve a list of products. The `products` query uses an argument (for example, `first`) to specify the number of results to query.
The following example shows how to query the IDs of the first 5 products in your store. For more information on selecting which set of results to query, refer to [Paginating results with GraphQL](/docs/api/usage/pagination-graphql).
## Query a single product
Products are identified by a globally unique ID, which can be used to query for information. You can use the [`product`](/docs/api/storefront/latest/queries/product) query to retrieve a single product. The following example shows how to pass in the product ID to the `product` query.
## Query product variants
A product variant represents a different version of a product, such as differing sizes or differing colors. You can query the variants associated with a product by querying `variants` on the [`Product`](/docs/api/storefront/latest/objects/Product) object.
## Query product recommendations
Product recommendations can help merchants boost sales and conversions. You can use the [`productRecommendations`](/docs/api/storefront/latest/queries/productRecommendations) query to retrieve a list of up to ten recommended products that display to customers. In your query, provide the following arguments:
- `productId`: The [global ID](/docs/api/usage/gids) of the product that's published to the storefront. This is the product for which the recommended products are generated.
- `intent`: The [type of recommendation set](/docs/api/storefront/unstable/enums/productRecommendationIntent) that will be generated. This helps you tailor recommendations for a particular surface on a storefront or selling strategy. For more information, refer to [recommendation intents](/docs/storefronts/themes/product-merchandising/recommendations#recommendation-intents).
The following example shows how to retrieve related product recommendations for a given product. The query returns the product IDs for each recommended product.
> Note:
> Shopify provides auto-generated product recommendations. Merchants can also [customize their product recommendations](https://help.shopify.com/manual/online-store/search-and-discovery/product-recommendations) using the [Shopify Search & Discovery app](https://apps.shopify.com/search-and-discovery).
## Query product media
You can use the Storefront API to query a product's media and display it on a storefront.
Specify the `media` field on the [`Product`](/docs/api/storefront/latest/objects/Product) object to query for a product's media. Then use a fragment to specify the fields that you want to return for each possible media type.
## Query collections
A collection represents a grouping of products that a store owner can create to organize them or make their stores easier to browse. For example, a merchant might create a collection for a specific type of product that they sell, such as footwear.
Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included.
The following example shows how to query for collections and the products that belong to those collections.
## Next steps
- [Filter products in a collection](/docs/storefronts/headless/building-with-the-storefront-api/products-collections/filter-products) with the Storefront API.
- [Create and update a cart](/docs/storefronts/headless/building-with-the-storefront-api/cart/manage) with the Storefront API.
- Learn about the [different tools](/docs/storefronts/headless/additional-sdks) that you can use to create unique buying experiences anywhere your customers are, including websites, apps, and video games.