Skip to main content

API Documentation

This section documents the available DiCRA API endpoints for regions, layer configuration, analytics, tiles, crop fire, LULC, use cases, and livestock data.

Base URL

https://api-v2-dicra.dev2prod.co/api/v2

1. Core Data Management (Regions and Categories)

Get All Regions

Retrieves all supported geographical regions.

DetailValue
Endpoint/getallregion
MethodGET

Response (200)

[
{"name": "TELANGANA", "id": 1},
{"name": "UTTARAKHAND", "id": 2}
]

Create Region

Registers a new region.

DetailValue
Endpoint/createregion
MethodPOST

Request Body

ParameterTypeDescription
namestringDisplay name of the new region
typestringRegion type (state or UT)
region_req_namestringRegion name used by frontend
{
"name": "string",
"type": "string",
"region_req_name": "string"
}

Response (200)

{
"success": true,
"Created_id": 1
}

Get All Categories

Retrieves all data categories.

DetailValue
Endpoint/getallcategory
MethodGET

Response (200)

[
{"category_name": "SOCIO-ECONOMIC", "id": 1},
{"category_name": "Environmental", "id": 2}
]

Create Category

Registers a new data category.

DetailValue
Endpoint/createcategory
MethodPOST

Request Body (implied): category name.

Delete Category

Deletes a category.

DetailValue
Endpoint/deletecategory
MethodDELETE

Request Body (implied): category id.

2. Layer Configuration and Metadata

Get Layer Configuration

Retrieves layer configuration by region.

DetailValue
Endpoint/getlayerconfig
MethodGET
Query Parameterregionid (integer)

Example: /getlayerconfig?regionid=1

Response (200, sample)

[
{
"isavailable": true,
"long_description": "NDVI quantifies vegetation...",
"display_name": "Normalized Difference Vegetation Index (NDVI)",
"layer_name": "NDVI",
"vector_status": true,
"yaxislabel": "NDVI",
"citation": "https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD13Q1#citations",
"showcustom": true,
"category_id": 1,
"short_description": "Normalized difference vegetation index",
"id": 2,
"raster_status": true
}
]

Create Layer

Creates a layer configuration.

DetailValue
Endpoint/createlayer
MethodPOST

Request Body (sample)

{
"unit": "string",
"xaxislabel": "string",
"isavailable": true,
"layer_name": "string",
"citation": "string",
"last_updated": "2025-11-13T06:42:52.269Z",
"standards": "string",
"short_description": "string",
"raster_status": true,
"timerangefilter": true,
"long_description": "string",
"vector_status": true,
"showcustom": true,
"source": "string",
"multiple_files": true,
"datafromvector": true,
"url": "string",
"display_name": "string",
"yaxislabel": "string",
"region_id": 0,
"category_id": 0
}

Update Layer

Updates an existing layer configuration.

DetailValue
Endpoint/updatelayer
MethodPOST

Request Body: same as Create Layer.

Delete Layer

Deletes an existing layer configuration.

DetailValue
Endpoint/deletelayer
MethodDELETE

Request Body (implied): layer_id.

Add Available Date (Parameter)

Registers an available date for a layer.

DetailValue
Endpoint/addparameter
MethodPOST
{
"available_date": "2025-11-13",
"layer_id": 0
}

Delete Available Date (Parameter)

Removes an available date for a layer.

DetailValue
Endpoint/deleteparameter
MethodDELETE
{
"available_date": "2025-11-13",
"layer_id": 0
}

3. Data Analytics and Trend Retrieval

Get Trend (Area-based)

Retrieves time-series trend data for a layer within a GeoJSON area.

DetailValue
Endpoint/gettrendzarr
MethodPOST
{
"geojson": {},
"startdate": "string",
"enddate": "string",
"layer_id": "string",
"state_name": "string"
}

Response (200)

{
"code": 200,
"trend": [
[1731715200000, 0.45],
[1733097600000, 0.47]
]
}

Get Trend (Point-based)

Retrieves time-series trend data for a specific latitude/longitude.

DetailValue
Endpoint/getpointtrendzarr
MethodPOST
{
"latitude": "string",
"longitude": "string",
"startdate": "string",
"enddate": "string",
"layer_id": "string",
"state_name": "string"
}

Get Zonal Statistics

Returns min, max, mean, and sum for a layer within a GeoJSON area and date.

DetailValue
Endpoint/getzstat
MethodPOST
{
"geojson": {},
"date": "string",
"layer_id": "string",
"state_name": "string"
}

Response (200)

{
"code": 200,
"stat": {
"min": -0.05,
"max": 0.83,
"mean": 0.61,
"sum": 1031.89
}
}

Get Pixel Value

Returns pixel value for a layer at a point.

DetailValue
Endpoint/getpixel
MethodPOST
{
"latitude": "string",
"longitude": "string",
"layer_id": "string",
"state_name": "string"
}

Response (200)

{
"code": 200,
"pixelvalue": 0.5
}

4. Map and Tile Service Endpoints

Get Current Vector Tile URL

Returns the .pmtiles URL for a layer and boundary type.

DetailValue
Endpoint/currentvector
MethodGET
{
"state_name": "string",
"Layer_id": "string",
"admbound": "SubDistrict/District"
}

Response (200)

{
"code": 200,
"vectorUrl": "https://dicratiler.blob.core.windows.net/dicra-dev/parameters/3/VECTOR/MANDAL/24-10-2025.pmtiles"
}

Get Raster Tile URL

Returns raster tile URL.

DetailValue
Endpoint/getrastourl
MethodPOST
{
"state_name": "string",
"Layer_id": "string"
}

Response (200)

{
"code": 200,
"rasterlayerUrl": "https://dicratiler.blob.core.windows.net/dicra-dev/parameters/2/RASTER_TILE/raster_tile.tif"
}

Get Blob Date

Returns available blob date information by layer.

DetailValue
Endpoint/geblobdate
MethodPOST
{
"state_name": "string",
"layer_type": "string",
"Layer_id": "string"
}

Alternate request format used in source:

{
"date": "string",
"state_name": "string",
"layer_type": "string",
"Layer_id": "string"
}

Get Warehouse Tile URL

Returns warehouse vector tile URL.

DetailValue
Endpoint/warehouses
MethodPOST
{
"state_name": "string",
"Layer_id": "string"
}

Get Cold Storage URL

Returns cold storage vector tile URL.

DetailValue
Endpoint/coldstoage
MethodPOST
{
"state_name": "string",
"Layer_id": "string"
}

Get District Name

Returns district names for custom-boundary workflows.

DetailValue
Endpoint/getdistrictname
MethodPOST
{
"geojson": {}
}

5. Crop Fire Endpoints

Get Crop Fire Tile URL

Returns crop fire vector tile URL.

DetailValue
Endpoint/cropfire
MethodPOST
{
"state_name": "string",
"Layer_id": "string"
}

Get Crop Fire Points

Returns crop fire points in area/time window.

DetailValue
Endpoint/cropfiregetpoint
MethodPOST
{
"geojson": {},
"startdate": "string",
"enddate": "string",
"layer_id": "string",
"state_name": "string"
}

Response (200, sample)

[
{
"code": 200,
"properties": [
{
"brightness": 314.88,
"acq_date": "2023-12-01",
"confidence": 60,
"geometry": "POINT (80.16143 18.16142)"
}
]
},
{"count": 2}
]

Get Crop Fire Events Trend

Returns crop fire event count trend.

DetailValue
Endpoint/cropfireeventstrend
MethodPOST
{
"geojson": {},
"startdate": "string",
"enddate": "string",
"layer_id": "string",
"state_name": "string"
}

Response (200)

{
"code": 200,
"trend": [
[1610928000000, 1],
[1613520000000, 2]
]
}

6. Land Use Land Cover (LULC) Endpoints

Get LULC Area

Calculates total area per LULC class in a GeoJSON area.

DetailValue
Endpoint/getlulcarea
MethodPOST
{
"geojson": {},
"layer_id": "string",
"state_name": "string"
}

Response (200, sample)

{
"code": 200,
"classes": {"1": "Water", "2": "Trees"},
"data": {
"01-01-2017": {"1": 215632, "2": 73464},
"01-01-2018": {"1": 145454, "2": 49001}
}
}

Get LULC Area Percentage

Calculates class-wise area percentages over time.

DetailValue
Endpoint/getlulcareapercentage
MethodPOST

Request Body: same as /getlulcarea.

Response (200): includes classes, percentage data by date/class, and trend series.

7. Use Case and Download Management

Create Use Case

Creates a use case entry (multipart form-data with image upload).

DetailValue
Endpoint/createusecase
MethodPOST

Form Fields

ParameterTypeDescription
project_namestringProject name
project_typestringProject classification
short_descriptionstringBrief summary
long_descriptionstringDetailed description
urlstringProject URL
imageUploadFileImage file
usernamestringCreator name
email_idstringCreator email
region_idintegerAssociated region ID

Get Use Cases (Paginated)

Retrieves use cases with filtering and pagination.

DetailValue
Endpoint/usecases/limit-offset
MethodGET

Query Parameters (implied): region, limit, offset.

Update Use Case URL

Updates URL for a use case.

DetailValue
Endpoint/updateusercase/{usecase_id}
MethodPOST

Path Parameter: usecase_id (integer).

8. Livestock Endpoints

Get THI Forecast

Returns THI values for upcoming days.

DetailValue
Endpoint/thi-forecast
MethodPOST
{
"latitude": "string",
"longitude": "string"
}

Response (200, sample)

[
{
"time": "2026-02-18",
"info": [{"type": "THI", "label": "THI", "value": 70}]
},
{
"time": "2026-02-19",
"info": [{"type": "THI", "label": "THI", "value": 69.7}]
}
]

Get THI Trend

Returns historical THI trend.

DetailValue
Endpoint/thi-trend
MethodPOST

start_date and end_date use YYYY-MM-DD.

{
"latitude": "string",
"longitude": "string",
"start_date": "string",
"end_date": "string"
}

Response (200, sample)

[
{"date_time": "2026-02-10", "value": 67.36},
{"date_time": "2026-02-11", "value": 67.98}
]

Get Livestock Census

Returns district-level livestock census data.

DetailValue
Endpoint/livestock-census
MethodPOST
{
"state_name": "string",
"district_name": "string"
}

Response (200, sample)

{
"code": 200,
"data": {
"fid": 91,
"state_name": "Odisha",
"district_name": "Cuttack",
"cattle": 548770,
"sheep": 67753,
"horse": 5,
"mule": 2,
"camel": 0,
"buffalo": 14827,
"goat": 221665,
"pony": 2,
"donkey": 1,
"pig": 932,
"total_animals": 853957,
"total_poultry": 1403204,
"vet_hospitals": 0,
"vet_doctors": 0,
"id": 251
}
}

Get Latest THI Data Token

Returns latest blob token/date value for THI.

DetailValue
Endpoint/thi-latest-date
MethodGET

Response (200, sample)

eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..XMxyoR4vX4uULjHz...