Skip to main content
This guide will help you get started with the Pure API v2 quickly. Follow these steps to make your first API request and start integrating with Pure’s precious metals marketplace.

Prerequisites

Before you begin, make sure you have:
  1. An API key from Pure (contact us at [email protected] to request one)
  2. A tool for making HTTP requests (like cURL, Postman, or your preferred programming language)

Authentication

The Pure API v2 uses API key authentication. Include your key in the x-api-key header with each request:
curl -X GET "https://api.collectpure.com/v1/protected" \
  -H "x-api-key: YOUR_API_KEY"

Making Your First Request

Let’s verify your authentication is working by making a request to the API information endpoint:
curl -X GET "https://api.collectpure.com/" \
  -H "x-api-key: YOUR_API_KEY"
If successful, you should receive a response like:
{
  "name": "Pure Public API",
  "version": "2.0.0",
  "description": "Public API for accessing Pure marketplace data",
  "documentation": "https://docs.collectpure.com",
  "endpoints": {
    "swagger": "https://api.collectpure.com/documentation/json",
    "health": "https://api.collectpure.com/health"
  }
}

Code Examples

JavaScript/Node.js

const axios = require("axios");

const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://api.collectpure.com";

async function getProducts(productIds) {
  try {
    const response = await axios.get(`${BASE_URL}/products/get-products/v1`, {
      headers: {
        "x-api-key": API_KEY,
      },
      params: {
        ids: productIds.join(',')
      }
    });
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error("Error fetching products:", error.response?.data || error.message);
  }
}

async function searchProducts(query) {
  try {
    const response = await axios.get(`${BASE_URL}/products/search-products/v1`, {
      headers: {
        "x-api-key": API_KEY,
      },
      params: {
        query: query
      }
    });
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error("Error searching products:", error.response?.data || error.message);
  }
}

async function getSpotPrices() {
  try {
    const response = await axios.get(`${BASE_URL}/marketplace/get-spot-price/v1`, {
      headers: {
        "x-api-key": API_KEY,
      }
    });
    console.log(response.data);
    return response.data;
  } catch (error) {
    console.error("Error fetching spot prices:", error.response?.data || error.message);
  }
}

// Usage
getProducts(["product-id-1", "product-id-2"]);
searchProducts("gold coin");
getSpotPrices();

Python

import requests

API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://api.collectpure.com'

def get_products(product_ids):
    headers = {
        'x-api-key': API_KEY
    }
    params = {
        'ids': ','.join(product_ids)
    }
    response = requests.get(f'{BASE_URL}/products/get-products/v1', headers=headers, params=params)

    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code}")
        print(response.json())
        return None

def search_products(query):
    headers = {
        'x-api-key': API_KEY
    }
    params = {
        'query': query
    }
    response = requests.get(f'{BASE_URL}/products/search-products/v1', headers=headers, params=params)

    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code}")
        print(response.json())
        return None

def get_spot_prices():
    headers = {
        'x-api-key': API_KEY
    }
    response = requests.get(f'{BASE_URL}/marketplace/get-spot-price/v1', headers=headers)

    if response.status_code == 200:
        return response.json()
    else:
        print(f"Error: {response.status_code}")
        print(response.json())
        return None

# Usage
products = get_products(["product-id-1", "product-id-2"])
search_results = search_products("gold coin")
spot_prices = get_spot_prices()

Error Handling

The API returns structured error responses. Here’s how to handle them:
try {
  const response = await axios.get(`${BASE_URL}/products/get-products/v1`, {
    headers: { "x-api-key": API_KEY },
    params: { ids: "invalid-id" }
  });
} catch (error) {
  if (error.response) {
    // Server responded with error status
    console.error("Error:", error.response.data.error);
    console.error("Code:", error.response.data.code);
    console.error("Suggestion:", error.response.data.suggestion);
  } else {
    // Network or other error
    console.error("Network error:", error.message);
  }
}

Next Steps

Now that you’ve made your first API requests, you can:
  1. Explore the API Reference to learn about all available endpoints
  2. Check out the Authentication Guide for detailed auth information
  3. Integrate the API into your application
  4. Contact us at [email protected] if you have any questions or need assistance

API Endpoints

The v2 API provides comprehensive access to Pure’s marketplace data through our OpenAPI specification. All endpoints are documented in the interactive API reference above, including:
  • Products: Get products by IDs, search, analytics, activity, and order book data
  • Reference Data: Categories, subcategories, manufacturers, attributes, and materials
  • Marketplace: Spot prices, order book stats, and shipping information
  • Authentication: Secure API key-based authentication
For the complete API specification, refer to the OpenAPI documentation in the API Reference tab.