About the StockX Developers Portal

Learn how to access and use the StockX Developers Portal, apply for API access, and explore alternatives with SneakersAPI.dev

Published on 10/19/2024 • 6 minute read

About the StockX Developers Portal

Initially, this website was exclusively focused on StockX products and was known as "Unofficial StockX API". At the start of our journey, we needed a method to retrieve products from StockX. Like many developers, our initial idea was to utilize the public API provided by the StockX Developers Portal. We signed up and submitted our application for review to gain access. However, at that time, our website was still under construction and quite new. After a few days, StockX declined our request, citing a lack of content as the reason.

Since then, things have changed. As our website has grown, we reapplied and were accepted after a waiting period of about two weeks. In this article, we aim to share insights about the official StockX API, including how to apply, get accepted, and ultimately, how to use it.


Why Use the StockX Developers Portal?

Whether you're managing a sneakers and fashion news website, a shopping website, an aggregator, or a comparator, you may need real selling data from marketplaces like StockX or GOAT. This is where the official StockX API comes into play. If you get approved, you can theoretically access the following APIs:

  • Catalog API: Allows searching for products, variants, and retrieving market data.
  • Order API: Enables retrieving active and historical sales on the platform.
  • Listing API: Useful for active sellers or ERP developers, allowing the addition of products to the marketplace.

How to Apply for StockX API Access?

To obtain an API Key and use the official StockX API, you need to sign up on their platform: StockX Developers Portal. You will then be asked to describe the purpose of your application or website. In our experience, the application process took about one to two weeks to get a response (either acceptance or refusal). If you are refused, you can reapply by contacting the support email.

Once accepted, you will receive your API Key and Application Credentials, and you will be ready to dive into their documentation.

Our single tip for this process is: provide a comprehensive description of your application or website, and ensure it is publicly available for the review team to check.

How to Use the StockX API?

The first step after creating your API Key and Application Credentials is to obtain an OAuth2 Token. This is the initial challenge of using the official StockX API, as you must authenticate through a browser. StockX employs PerimeterX bot detection, making it difficult to bypass and impossible to automate token generation without a workaround.

If you choose to proceed with browser authentication, follow these steps:

  1. Open a Browser and Enter the URL: Replace the parameters with your specific details:
 https://accounts.stockx.com/authorize?
     response_type=code&
     client_id={APPLICATION_ID}&
     redirect_uri={APPLICATION_REDIRECT_URI}&
     scope=offline_access%20openid&
     audience=gateway.stockx.com&
     state={OPAQUE_STATE_VALUE}
  • Application ID: Found on the developers portal.
  • Redirect URI: Your website with a callback handler (e.g., https://sneakersapi.dev/callback).
  • State: An arbitrary value used to prevent CSRF; for testing, you can use any value.

  • Redirect and Save the Code: You will be redirected to your website with a code query string, like this: https://sneakersapi.dev/callback?code=..... Save this code for the next step. The state is also present, ensure you check it if using this in a production environment.

  • Obtain a Temporary Token:

Make the following request on your backend:

curl --request POST \
  --url 'https://accounts.stockx.com/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=authorization_code' \
  --data 'client_id={YOUR_CLIENT_ID}' \
  --data 'client_secret={YOUR_CLIENT_SECRET}' \
  --data 'code={YOUR_AUTHORIZATION_CODE}' \
  --data 'redirect_uri={YOUR_CALLBACK_URI}'
  • Client ID and Client Secret: Your application credentials.
  • Code: The code received after the browser redirection.
  • Callback URI: Needed to verify the code's origin.

  • Receive the Tokens:

You will receive a response like this:

{
    "access_token": "eyJz93a...k4laUWw",
    "refresh_token": "GEbRxBN...edjnXbL",
    "id_token": "eyJ0XAi...4faeEoQ",
    "token_type": "Bearer"
}

Save the refresh_token carefully, as it is valid for 30 days and will prevent you from repeating this process.

The access_token is valid for 12 hours, the refresh_token for 30 days. In order to stay concise, we are not going to explain how to refresh the token here, please refer to their documentation.

Make your first request on the StockX API

Congratulations, you now have a temporary token. We can finally make a request to retrieve product listings and explore the StockX product catalog. As of 2024, their API offers the /v2/catalog/search endpoint, so let's use it!

curl -i -X GET \
  "https://api.stockx.com/v2/catalog/search?query=Nike SB Dunk&pageNumber=1&pageSize=1" \
  -H "Authorization: Bearer <YOUR_JWT_HERE>" \
  -H "x-api-key: YOUR_API_KEY_HERE"

You can appreciate the complexity of the StockX API once again. After completing browser authentication and backend confirmation, you still need two tokens: the temporary token and your API Key.

You should receive a response similar to this:

{
    "count": 934,
    "pageNumber": 1,
    "pageSize": 1,
    "hasNextPage": true,
    "products": [
        {
            "productId": "7ea982a1-ef10-4538-b8b2-b69da275d085",
            "brand": "Nike",
            "productType": "sneakers",
            "styleId": "CD2563-101",
            "urlKey": "nike-sb-dunk-low-pro-white-gum",
            "title": "Nike SB Dunk Low Pro White Gum",
            "productAttributes": {
                "color": null,
                "colorway": "White/Black/White/Gum Light Brown",
                "gender": "men",
                "releaseDate": "2023-03-01",
                "retailPrice": null,
                "season": null
            }
        }
    ]
}

Our Thoughts on the Official StockX API

To be frank, at SneakersAPI.dev, we were quite disappointed with the official StockX API. We don't even use it in our scraping process. Here are our main concerns:

  • Excessively Complex Authentication: The authentication process is unnecessarily complicated, especially considering the API is already rate-limited (25,000 requests in 24 hours) and applicants undergo manual review. Protecting an API with PerimeterX is overkill.
  • Limited API Functionality: The API is too restrictive, offering only searching and variants listing. We were never able to get the /market-data endpoint to work.
  • Lack of Detailed Responses: The API responses are not detailed enough. In 2024, it's disappointing to receive only the product title, slug, style ID, colorway, and release date. What's more frustrating is that their website displays additional information such as retail price and season, but the API always returns null values for these fields.

We reached out to the StockX developers team to request a simpler authentication process and access to the main website API (which is in GraphQL), but our request was refused.

A Simpler Alternative: SneakersAPI.dev

At SneakersAPI.dev, our job is scraping sneakers and fashion markets. We tried to make our API as user-friendly as possible. For basic operations like getting products and variants, you can use our free API without any registration. Our free tier includes data from StockX, covering around 175,000 products and 800,000 variants (sizes).

Requesting data is straightforward:

curl --request GET \
  --url "https://api.sneakersapi.dev/api/v2/products?search=Nike SB Dunk"

You'll receive a detailed response with notably:

  • Brand
  • Product title, description, images, keywords and SKU
  • Size and gender
  • Aggregated prices (lowest price, highest price, average price, etc.)
  • Every available variants with links, GTIN/EAN code, size and their daily price.

We also offer two paid plans with additional features:

  • Market Data: Access price movements over time for better price prediction and selling.
  • Expanded Data Sources: Get data from other marketplaces like Nike, Adidas, Converse, New Balance. Including more images, better product descriptions, etc.
  • Advanced Filtering and Ranking: Access features like best-selling products and weekly sales.

Our paid plans start at $9.99/month, which we believe is a great value if you don't want to deal with the official API or other scrapers. We're currently the most affordable StockX data provider on the market, offering the most comprehensive free tier.


Tags:

APIs
Retail API
StockX

SneakersAPI.dev

© 2024-2025 SneakersAPI.dev. All rights reserved.

Business registered in France • SIRET: 92426948300013