AMEE API / AMEE Data API / Data Item Resource

Overview

Data Items are retrieved via their unique URLs. Data Item URLs can be determined by browsing the parent nodes in the resource URL structure (the Data Categories).

By supplying name / value pairs (such as distanceKmPerMonth=1000) in a GET request the CO2 'amountPerMonth' value can be retrieved. The name / value pairs must match the 'userValueChoices' list included in the response.

Example Data Item URL: /data/transport/car/specific/3D56CB495286

Example JSON Response

{
  "amountPerMonth" : 235.75,
  "userValueChoices" : {
    "choices" : [
      {
        "value" : "1000",
        "name" : "distanceKmPerMonth"
      }
    ],
    "name" : "userValueChoices"
  },
  "path" : "/transport/car/specific/3D56CB495286",
  "dataItem" : {
    "modified" : "2007-05-22 16:50:17.0",
    "created" : "2007-05-22 16:50:17.0",
    "itemDefinition" : {
      "uid" : "E134192B6580"
    },
    "itemValues" : [
      {
        "value" : "ALFA ROMEO",
        "uid" : "2F344DE835DE",
        "path" : "manufacturer",
        "name" : "Manufacturer"
      },
      {
        "value" : "159",
        "uid" : "272C7286B061",
        "path" : "model",
        "name" : "Model"
      },
      {
        "value" : "1.9 JTS",
        "uid" : "5256F5872E00",
        "path" : "description",
        "name" : "Description"
      },
      {
        "value" : "M6",
        "uid" : "7AFB26A14B27",
        "path" : "transmission",
        "name" : "Transmission"
      },
      {
        "value" : "1859",
        "uid" : "BB36A70BF9FC",
        "path" : "engineCapacity",
        "name" : "Engine Capacity"
      },
      {
        "value" : "Petrol",
        "uid" : "DC96FF0CD724",
        "path" : "fuelType",
        "name" : "Fuel Type"
      },
      {
        "value" : "0.205",
        "uid" : "6650FD8F7C8D",
        "path" : "kgCO2PerKm",
        "name" : "kgCO2 Per Km"
      },
      {
        "value" : "http://www.vcacarfueldata.org.uk/downloads/latest.asp 12 January 2006",
        "uid" : "CC384C8859D6",
        "path" : "source",
        "name" : "Source"
      }
    ],
    "label" : "ALFA ROMEO, 159, 1.9 JTS, M6, 1859, Petrol",
    "dataCategory" : {
      "uid" : "1EB241FAEF1F"
    },
    "uid" : "3D56CB495286",
    "environment" : {
      "uid" : "7689472BC0FE"
    },
    "path" : "",
    "name" : "3D56CB495286"
  }
}

Example XML Response

<?xml version="1.0" encoding="UTF-8"?>
<Resources>
    <DataItemResource>
        <DataItem created="2007-05-22 16:50:17.0" modified="2007-05-22 16:50:17.0" uid="3D56CB495286">
            <Name>3D56CB495286</Name>
            <Environment uid="7689472BC0FE"/>
            <ItemDefinition uid="E134192B6580"/>
            <DataCategory uid="1EB241FAEF1F"/>
            <ItemValues>
                <ItemValue uid="2F344DE835DE">
                    <Path>manufacturer</Path>
                    <Name>Manufacturer</Name>
                    <Value>ALFA ROMEO</Value>
                </ItemValue>
                <ItemValue uid="272C7286B061">
                    <Path>model</Path>
                    <Name>Model</Name>
                    <Value>159</Value>
                </ItemValue>
                <ItemValue uid="5256F5872E00">
                    <Path>description</Path>
                    <Name>Description</Name>
                    <Value>1.9 JTS</Value>
                </ItemValue>
                <ItemValue uid="7AFB26A14B27">
                    <Path>transmission</Path>
                    <Name>Transmission</Name>
                    <Value>M6</Value>
                </ItemValue>
                <ItemValue uid="BB36A70BF9FC">
                    <Path>engineCapacity</Path>
                    <Name>Engine Capacity</Name>
                    <Value>1859</Value>
                </ItemValue>
                <ItemValue uid="DC96FF0CD724">
                    <Path>fuelType</Path>
                    <Name>Fuel Type</Name>
                    <Value>Petrol</Value>
                </ItemValue>
                <ItemValue uid="6650FD8F7C8D">
                    <Path>kgCO2PerKm</Path>
                    <Name>kgCO2 Per Km</Name>
                    <Value>0.205</Value>
                </ItemValue>
                <ItemValue uid="CC384C8859D6">
                    <Path>source</Path>
                    <Name>Source</Name>
                    <Value>http://www.vcacarfueldata.org.uk/downloads/latest.asp 12 January 2006</Value>
                </ItemValue>
            </ItemValues>
            <Path>3D56CB495286</Path>
            <Label>ALFA ROMEO, 159, 1.9 JTS, M6, 1859, Petrol</Label>
        </DataItem>
        <Path>/transport/car/specific/3D56CB495286</Path>
        <Choices>
            <Name>userValueChoices</Name>
            <Choices>
                <Choice>
                    <Name>distanceKmPerMonth</Name>
                    <Value>1000</Value>
                </Choice>
            </Choices>
        </Choices>
        <AmountPerMonth>235.750</AmountPerMonth>
    </DataItemResource>
</Resources>

Supported HTTP Methods

  • GET
  • PUT

Parameter Definition

ParameterDefinitionMethods
{valueName}A value supplied for CO2 calculations. Multiple name / value pairs can be supplied. The value name must be one of those listed in the choices list returned in the JSON or XML response.GET
nameThe updated name for this Data Item.PUT
pathThe updated path for this Data Item.PUT
{valueName}Update a Data Item Value by specifying the name and value. For example, the value name could be 'distance' supplied with a value of '300'. Multiple name & value pairs can be submitted so long as the Item Values exist within the Data Item.PUT