ICAR logo

Observational Data Repository

(Data from Observational Studies Collected by ICAR institutes)
(Agricultural Knowledge Resources and Information System Hub for Innovations)
(An initiative of Indian Council of Agricultural Research)

Client Apps Example for Observation Data Web Services

Here given example of REST Client: CURL and Python. In Observation data access by web services (JSON) with login credential.

Browser REST Plugin

For JSON data testing use browser based plugins.
e.g.: Google Chrome baased plugin: chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/restlet_client.html

CURL

By a linux terminal utility CURL, you can access Observation Data as by given example for IARI: ( here also user as Query Parameter for OffSet use for start of records and Limit use for number of records (?OffSet=50&Limit=1) and need to convert username and password into Basic Authorization token )

curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization:Basic dXNlcjFAZ21haWwuY29tOnVzZXJi" https://krishi.icar.gov.in/ObservationData/REST/GetUrl/iari | json_reformat
Output:
[
    {
        "date": "2017-09-14",
        "max_temp": "35.8",
        "min_temp": "25.0",
        "rainfall": "0.00",
        "windspeed": "2.9",
        "wdc_I": "C",
        "wdc_II": "W",
        "weathercon_I": "1",
        "weathercon_II": "1",
        "rh_I": "94.0",
        "rh_II": "58.0",
        "bss": "8.4",
        "evap": "4.3"
    },
    .
    .    

Python

Python code example given here:

## call headers
import requests
from requests.auth import HTTPBasicAuth

## fech data by URL
r = requests.get('https://krishi.icar.gov.in/ObservationData/REST/GetUrl/iari?OffSet=50&Limit=1', auth=HTTPBasicAuth('username', 'password'))
## store data into dictionary 
json_data=r.json()

## Print dictionary
dataJson=r.json()
for x in dataJson:
    for key,val in x.items():
    	print key, " => ", val	
Output:
weathercon_I  =>  1
rainfall  =>  0.00
rh_I  =>  50.0
evap  =>  8.3
bss  =>  6.0
wdc_I  =>  N
windspeed  =>  6.0
wdc_II  =>  NW
date  =>  2018-06-24
min_temp  =>  26.0
weathercon_II  =>  0
rh_II  =>  37.0
max_temp  =>  43.0

Client Web Application for KRISHI Observation Data Repository

A client web application for KRISHI Observation Data Repository given here Observation Data Client Example and source code available here
List of URI for agro-meteorology center to use in iframe

Avilable Web Services URL links

Center List (Manual Data Feeding): https://krishi.icar.gov.in/ObservationData/REST/GetUrl/CenterRecord?OffSet=0&Limit=60&InstituteId=38
Record List (Manual Data Feeding): https://krishi.icar.gov.in/ObservationData/REST/GetUrl/CenterDataRecord?OffSet=0&Limit=60&CenterId=4
IARI: https://krishi.icar.gov.in/ObservationData/REST/GetUrl/iari
IIHR: https://krishi.icar.gov.in/ObservationData/REST/GetUrl/iihr

Top

Important Links