KTBL Database - APIs
The KTBL Database provides information about contribution margins (including prices and yields), standard gross margins, and production process specifications for a wide variety of crops. Currently, there is no native API for the calculated data implemented on their site. This repo provides a (scraping) client aimed at filling that gap.
Installation
npm install ktbl-apis
Table of content
- Methods
API
cropList([options])
Returns an array of strings with all available options for the query.
options
<object>farmingType
<string>crop
<string>system
<string>
Results are obtained from the KTBL Verfahrensrechner Tool.
Examples:
const ktbl = // Query all available farming typesktbl // query all crops for a certain farming typektbl // query all systems for a certain crop of a farming typektbl // query all available specifications for a combination of// farmingType, crop, and system.// Will return an array of objects that can be chained with the cropProcedures methodktbl
contributionMargin(options)
Returns the default KTBL contribution margin for a crop.
options
<object>farmingType
<string>crop
<string>system
<string>
Results are obtained from the KTBL Leistungs-Kostenrechnung Pflanzenbau Tool.
Example:
const ktbl = // Query default KTBL contribution margin for a cropktbl
standardGrossMargin(crop, region)
Returns the prices, yields, direct costs and standard gross margins from 2001 - present for a crop in a specific region. Region can be any state (Bundesland) or county (Regierungsbezirk) in Germany.
As the standard gross margin is not available for all crops that are present in the other methods, a more or less intelligent guess is made which crop (or crop group) is most suitable for the query.
- crop <string>
- region <string> Default: All available regions
Results are obtained from the KTBL SDB Databse Tool.
Example:
const ktbl = // Query standard gross margin for a cropktbl
cropProcedures(options)
Returns an array of objects with all standard working procedures defined for a given crop / cropping system combination.
See the cropList
method for all available combinations of farmingType
, crop
, system
and the other specifications.
options
<object>farmingType
<string>crop
<string>system
<string>size
<string>|<integer> Default:2
yield
<string> Default: KTBL default valuedistance
<string>|<integer> Default:2
getIds
<bool> Default:false
Results are obtained from the KTBL Verfahrensrechner Tool.
Example:
const ktbl = // Query crop proceduresktbl
procedure(options)
Returns information on a single working procedure.
The available procedureGroup
, procedure
, and machCombination
combinations can be queried with the getIds
option of the cropProcedures
method.
options
<object>procedureGroup
<string>|<integer>procedure
<string>|<integer>machCombination
<string>|<integer>size
<string>|<integer> Default:2
resistance
<string> Default: KTBL default valuedistance
<string>|<integer> Default:2
amount
<string>|<integer> Default: KTBL default valueworkingWidth
<string>|<integer> Default: KTBL default value
Results are obtained from the KTBL Feldarbeitsrechner Tool.
Example:
const ktbl = // Query a single working stepktbl
Legal notice
This repo is not affiliated to KTBL and thus only shows a potential way to access the database via API.