Documentation / Endpoints / GET /api/variants

GET /api/variants

Public

Retrieve device variants as first-class entities with full attribute information and device context.

Authentication

Requires Public tier or higher.

Query Parameters

ParameterTypeRequiredDescription
pageintegerPage number (default: 1)
limitintegerResults per page (default: 20, max: 100)
device_idstringFilter by device ID
storagestringFilter by storage (e.g., "128GB")
colorstringFilter by color (e.g., "Space Black")
carrierstringFilter by carrier (e.g., "Unlocked")
disabledbooleanFilter by disabled status

Example Request

curl "https://api.souratlas.io/api/variants?device_id=apple-iphone-14-pro&storage=128GB" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "success": true,
  "data": [
    {
      "id": "var_iphone14pro_128_black",
      "sku": "MPXV3LL/A",
      "price": 99900,
      "name": "128GB Space Black",
      "part_numbers": ["MPXV3LL/A"],
      "model_numbers": ["A2650"],
      "thumbnail": "https://cdn.souratlas.io/variants/iphone-14-pro-black.png",
      "attributes": [
        { "attribute_name": "Storage", "attribute_value": "128GB" },
        { "attribute_name": "Color", "attribute_value": "Space Black" }
      ],
      "disabled": false,
      "device": {
        "id": "apple-iphone-14-pro",
        "name": "Apple iPhone 14 Pro",
        "slug": "apple-iphone-14-pro",
        "make": {
          "name": "Apple",
          "thumbnail": "https://cdn.souratlas.io/makes/apple.png"
        },
        "category": {
          "name": "Smartphones",
          "thumbnail": "https://cdn.souratlas.io/categories/smartphones.png"
        }
      }
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 4,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

Response includes variants with device context. See Variant schema.

Error Responses

StatusError CodeDescription
401UNAUTHORIZEDMissing or invalid API key
429RATE_LIMIT_EXCEEDEDRate limit exceeded
500INTERNAL_ERRORInternal server error