...
ECMWF makes available a GRIB decoding library (ecCodes) for the benefit of the WMO community. ecCodes can be freely downloaded from here and the documentation can be found here.
ecCodes provides a simplified access to GRIB2 headers through a set of virtual keys documented here.
...