Skip to main content
07399 456 959 [email protected]

Product Fields
Last updated: January 05 2022 11:19 PM

Fields Parameter Values Available For Products

A way to improve the performance of your API request is by requesting a partial response receiving only the data that your application is interested in. This allows your application to perform more efficiently. By default, the server sends back the full representation of a resource you requested. For improved performance, you can request only the fields you need. To request a partial response, use the fields query parameter and specify the fields you want returned.

You can use the fields parameter with almost all endpoints. Use a comma-separated list to select multiple fields. E.g. /?fields=products(heading,introduction)

Parameter Type Values Description and examples
fields
optional
string heading,
introduction,
meta-data-title,
meta-data-description,
meta-data-keywords,
Returns a single or multiple strings of information about the product

/?fields=products(heading,introduction)
fields
optional
string os,
family-os,
weight,
size,
height,
width,
depth,
screen-size,
screen-pixel-density,
screen-resolution,
sim-type,
display-type,
handset-style,
camera-front,
camera-back,
camera-flash,
battery-type,
battery-capacity,
chipset,
gpu,
cpu,
nfc,
sensors,
fm-radio,
4g
Returns a single or multiple specifications for a product or products

/?fields=products(height,width,depth)
fields
optional
string front,
back,
right,
left,
large,
medium,
small,
jpg,
png,
webp
Returns a single or multiple image src

/?fields=products(front,back,medium,jpg)
/?fields=products(front,large,png)

Product Fields Request Example

GET
https://api.uconvert.co.uk/deals/v1/products/?fields=products(heading)
{
  "products" : [
    {
      "id": "1032",
      "name": "Apple iPhone 6 Plus 16GB Gold",
      "slug": "apple-iphone-6-plus-16gb-gold",
      "content": {
        "heading": "Apple iPhone 6 Plus 16GB Gold mobile phone deals"
      }
    },
  ]
}
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.uconvert.co.uk/deals/v1/products/?fields=products(heading)",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-api-key: 123456"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
curl --request GET \
  --url 'https://api.uconvert.co.uk/deals/v1/products/?fields=products(heading)' \
  --header 'x-api-key: 123456'
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.uconvert.co.uk/deals/v1/products/?fields=products(heading)",
  "method": "GET",
  "headers": {
    "x-api-key": "123456"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
require 'uri'
require 'net/http'

url = URI("https://api.uconvert.co.uk/deals/v1/products/?fields=products(heading)")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '123456'

response = http.request(request)
puts response.read_body