Agri-food Data API Guide

The sections below presuppose that you already know what a Web API is, and how to retrieve information from the JSON-formatted reply.

Overview

This describes the resources that make up the official Public Agri-food Data API.

attention All APIs can be found under /api.

HTTP verbs

Agri-food Data tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb Usage

GET

Used to retrieve a resource

info note Due to some limitations of the reverse proxy, some HTTP methods might be forbidden. To overcome this, you can add a _method request parameter containing the name of the desired HTTP verb. Example: ?_method=get.

API gateway errors

An API gateway is put in place to protect against abusive behaviour. We have in place a rate limiting policy to protect the application and the ability for users to fetch data in an orderly and sensible manner.

Below a list of error responses that the client could receive from the gateway.

Response Status Code Description Response content

404

Not found

{
	"code": "404",
	"type": "Status report",
	"message": "Runtime Error",
	"description": "No matching resource found for given API Request"
}

405

Method not allowed

{
    "code": "405",
    "type": "Status report",
    "message": "Runtime Error",
    "description": "Method not allowed for given API resource"
}

429

Too many requests

{
	"code": "900802",
	"message": "Message throttled out",
	"description": "You have exceeded your quota .You can access API after 2026-Mar-25 15:16:00+0000 UTC",
	"nextAccessTime": "2026-Mar-25 15:16:00+0000 UTC"
}

503

Service unavailable

{
	"code": "900801",
	"message": "API Limit Reached",
	"description": "API not accepting requests"
}

Date and time

All services return dates in dd/MM/yyyy format.

How Date filtering works

"BeginDate" and "EndDate" parameters restrict the entire week, whereas "Months" parameter only applies to the starting date of the week of the Marketing Year.

In other words "Months" is based only on "Begin Date" and this behaviour is consistent through all sectors.

Sorting mechanism

By default prices APIs return results in an ordered manner. Unless stated in a specific sector, the priority follows the below order :

  1. Begin Date in reverse chronological order
  2. Member State Name in alphabetical order

For weekly TAXUD imports & exports APIs the ordering priority is as follows :

  1. Marketing Year in reverse chronological order
  2. Week in reverse chronological order
  3. Member State Name in alphabetical order
  4. TARIC 10 code in ascending order

For the CMEF Indicators values the ordering priority is as follows :

  1. Year in reverse chronological order
  2. Indicator in ascending order
  3. Sub-indicator in ascending order
  4. Parameter in ascending order
  5. Code in ascending order
  6. Source in ascending order
  7. Member State Name in alphabetical order