The RiceVarMap v3 REST API provides programmatic access to reference metadata,
cultivar catalogs, variants, gene metadata, gene-region variants, coordinate
conversion cache, primer design, and genotype queries. Responses use a stable JSON object with
ok, data, meta, and error.
Overview
Base URL
https://ricevarmap.ncpgr.cn/v3/api
Request Conventions
- GET endpoints accept query-string parameters.
- POST endpoints accept a JSON object with
Content-Type: application/json.
- All successful and failed responses use the same envelope:
ok, data, meta, and error.
- Response samples are shortened when arrays are long, but field names and nesting match the live API.
- Coordinates are 1-based and chromosome names use
chr01 through chr12.
Endpoint Index
Endpoints by Method
GET Endpoints
GET endpoints use query-string parameters and are intended for read-only metadata,
search, variant lookup, and cache lookup operations.
GET /health
| Parameter | Required | Type | Description |
| No parameters. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/health'
Response Sample
{
"ok": true,
"data": {
"service": "ricevarmap3",
"status": "ok"
},
"meta": {"api_version": "v3"},
"error": null
}
GET /references
| Parameter | Required | Type | Description |
| No parameters. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/references'
Response Sample
{
"ok": true,
"data": {
"references": [
{"id": "NIP", "label": "Nipponbare / IRGSP-1.0", "variant_prefix": "vg", "supports_str": true},
{"id": "ZS97", "label": "ZS97RS3", "variant_prefix": "vz", "supports_str": false},
{"id": "MH63", "label": "MH63RS3", "variant_prefix": "vm", "supports_str": false}
]
},
"meta": {"api_version": "v3"},
"error": null
}
GET /populations
| Parameter | Required | Type | Description |
| No parameters. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/populations'
Response Sample
{
"ok": true,
"data": {
"populations": [
{"code": "All", "label": "All"},
{"code": "Ind_All", "label": "All Indica"},
{"code": "Jap_All", "label": "All Japonica"},
{"code": "TeJ", "label": "Temperate Japonica"},
{"code": "TrJ", "label": "Tropical Japonica"}
]
},
"meta": {"api_version": "v3"},
"error": null
}
GET /cultivars
| Parameter | Required | Type | Description |
q | No | string | Search by cultivar ID, name, subpopulation, or location. Maximum length: 100 characters. |
subpopulation | No | string | Exact subpopulation code filter, such as TeJ, IndI, or Aus. Use All or omit it for all cultivars. |
location | No | string | Location text filter, such as China. Maximum length: 100 characters. |
limit | No | integer | Number of rows to return. Default: 100. Maximum: 1000. |
offset | No | integer | Zero-based pagination offset. Default: 0. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/cultivars?q=Heibiao&subpopulation=TeJ&location=China&limit=1'
Response Sample
{
"ok": true,
"data": {
"cultivars": [
{
"id_name": "B001",
"name": "Heibiao",
"subpopulation": "TeJ",
"location": "China",
"longitude": null,
"latitude": null
}
],
"count": 4726,
"limit": 1,
"offset": 0
},
"meta": {"api_version": "v3"},
"error": null
}
GET /variants/<var_id>
| Parameter | Required | Type | Description |
var_id | Yes | path string | Variant ID such as vg0100001306, vz0100013877, vm0100005869, or STR0100000001. |
include | No | string | Comma-separated sections. Allowed values: basic, frequency. Default: basic,frequency. |
population | No | string | Return frequency for one population only. Allowed population codes include All, Ind_All, Jap_All, TeJ, and TrJ. Omit it to return all populations. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/variants/vg0100001306?include=basic,frequency&population=All'
Response Sample
{
"ok": true,
"data": {
"variant": {
"var_id": "vg0100001306",
"reference": "NIP",
"chr": "chr01",
"pos": 1306,
"type": "SNP",
"ref": "G",
"alt": "A"
},
"frequency": [
{
"population": "All",
"major_genotype": "G",
"minor_genotype": "A",
"major_rate": 0.984,
"minor_rate": 0.015,
"count": 4726
}
]
},
"meta": {"api_version": "v3"},
"error": null
}
GET /variants/by-region
| Parameter | Required | Type | Description |
reference | No | string | Reference genome. Allowed values: NIP, ZS97, MH63. Default: NIP. |
chr | Yes | string | Chromosome name from chr01 to chr12. |
start | Yes | integer | Start coordinate, minimum 1. |
end | Yes | integer | End coordinate, greater than start. Maximum interval length: 100000 bp. |
type | No | string | Allowed values: All, SNP, INDEL, STR. Default: All. STR is available only for NIP. |
population | No | string | Frequency population used for each returned variant. Default: All. |
limit | No | integer | Default: 100. Maximum: 1000. |
offset | No | integer | Default: 0. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/variants/by-region?reference=NIP&chr=chr01&start=10000&end=20000&population=All&limit=1'
Response Sample
{
"ok": true,
"data": {
"variants": [
{
"var_id": "vg0100010532",
"reference": "NIP",
"chr": "chr01",
"pos": 10532,
"type": "SNP",
"ref": "G",
"alt": "T",
"population": "All",
"major_genotype": "G",
"minor_genotype": "T",
"major_rate": 0.995,
"minor_rate": 0.005,
"count": 4726
}
],
"count": 164,
"limit": 1,
"offset": 0,
"reference": "NIP",
"chr": "chr01",
"start": 10000,
"end": 20000,
"type": "All",
"population": "All"
},
"meta": {"api_version": "v3"},
"error": null
}
GET /genes/<gene_id>
| Parameter | Required | Type | Description |
gene_id | Yes | path string | Gene ID. NIP examples use LOC_Os; ZS97 IDs start with OsZS; MH63 IDs start with OsMH. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/genes/LOC_Os05g32860'
Response Sample
{
"ok": true,
"data": {
"gene": {
"gene_id": "LOC_Os05g32860",
"transcript_id": "LOC_Os05g32860.1",
"reference": "NIP",
"chr": "chr05",
"start": 19240767,
"end": 19241433,
"strand": "+",
"note": "expressed protein"
}
},
"meta": {"api_version": "v3"},
"error": null
}
GET /genes/search
| Parameter | Required | Type | Description |
q | Yes | string | Search text for gene ID, transcript ID, or annotation. Maximum length: 100 characters. |
reference | No | string | Reference genome. Allowed values: NIP, ZS97, MH63. Default: NIP. |
limit | No | integer | Default: 100. Maximum: 1000. |
offset | No | integer | Default: 0. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/genes/search?reference=NIP&q=LOC_Os05g32860&limit=5'
Response Sample
{
"ok": true,
"data": {
"genes": [
{
"gene_id": "LOC_Os05g32860",
"transcript_id": "LOC_Os05g32860.1",
"reference": "NIP",
"chr": "chr05",
"start": 19240767,
"end": 19241433,
"strand": "+",
"note": "expressed protein"
}
],
"count": 1,
"limit": 5,
"offset": 0,
"reference": "NIP",
"q": "LOC_Os05g32860"
},
"meta": {"api_version": "v3"},
"error": null
}
GET /genes/<gene_id>/variants
| Parameter | Required | Type | Description |
gene_id | Yes | path string | Gene ID. NIP examples use LOC_Os; ZS97 IDs start with OsZS; MH63 IDs start with OsMH. |
up | No | integer | Upstream flank length. Default: 2000. Range: 0-10000. |
down | No | integer | Downstream flank length. Default: 1000. Range: 0-10000. |
population | No | string | Frequency population used for each returned variant. Default: All. |
limit | No | integer | Default: 100. Maximum: 1000. |
offset | No | integer | Default: 0. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/genes/LOC_Os05g32860/variants?up=2000&down=1000&population=All&limit=1'
Response Sample
{
"ok": true,
"data": {
"gene": {
"gene_id": "LOC_Os05g32860",
"transcript_id": "LOC_Os05g32860.1",
"reference": "NIP",
"chr": "chr05",
"start": 19240767,
"end": 19241433,
"strand": "+",
"note": "expressed protein"
},
"population": "All",
"query_interval": {
"chr": "chr05",
"start": 19238767,
"end": 19242433,
"up": 2000,
"down": 1000
},
"variants": [],
"count": 71,
"limit": 1,
"offset": 0
},
"meta": {"api_version": "v3"},
"error": null
}
GET /coordinates/convert
| Parameter | Required | Type | Description |
var_id | Yes | string | Variant ID to convert through the coordinate-conversion cache. |
cache_only | No | boolean | Only true is currently supported. Default: true. |
Request Example
curl -s 'https://ricevarmap.ncpgr.cn/v3/api/coordinates/convert?var_id=vg0100001306&cache_only=true'
Response Sample
{
"ok": true,
"data": {
"var_id": "vg0100001306",
"reference": "NIP",
"source_genome": "nip",
"rows": [
{
"window_label": "Up 100bp",
"nip_id": "vg0100001306",
"zs_id": "vm0100005869",
"mh_id": "NA"
}
]
},
"meta": {"api_version": "v3"},
"error": null
}
POST Endpoints
POST endpoints accept a JSON object in the request body. They are used for batch
operations, primer design, and genotype queries.
POST /cultivars/batch
| JSON field | Required | Type | Description |
cultivars | Yes | array | Cultivar IDs such as B001 or C145. Maximum: 500 IDs. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/cultivars/batch' \
-H 'Content-Type: application/json' \
-d '{"cultivars":["B001","C145"]}'
Response Sample
{
"ok": true,
"data": {
"results": [
{
"id_name": "B001",
"name": "Heibiao",
"subpopulation": "TeJ",
"location": "China",
"longitude": null,
"latitude": null
}
],
"count": 1,
"used_cultivars": ["B001"],
"not_found": []
},
"meta": {"api_version": "v3"},
"error": null
}
POST /variants/batch
| JSON field | Required | Type | Description |
var_ids | Yes | array | Variant IDs. Maximum: 500 IDs for basic-only requests, or 200 IDs when frequency is included. |
include | No | string or array | Allowed values: basic, frequency. Default: basic,frequency. |
population | No | string | Return frequency for one population only. Omit it to return all populations. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/variants/batch' \
-H 'Content-Type: application/json' \
-d '{"var_ids":["vg0100001306","vg0701959554"],"include":["basic","frequency"],"population":"All"}'
Response Sample
{
"ok": true,
"data": {
"results": [
{
"var_id": "vg0100001306",
"reference": "NIP",
"variant": {
"var_id": "vg0100001306",
"reference": "NIP",
"chr": "chr01",
"pos": 1306,
"type": "SNP",
"ref": "G",
"alt": "A"
},
"frequency": [
{"population": "All", "major_genotype": "G", "minor_genotype": "A", "major_rate": 0.984}
]
}
],
"count": 1,
"used_variants": ["vg0100001306"],
"not_found": [],
"include": ["basic", "frequency"],
"population": "All"
},
"meta": {"api_version": "v3"},
"error": null
}
POST /genes/batch
| JSON field | Required | Type | Description |
gene_ids | Yes | array | Gene IDs. Maximum: 200 IDs. NIP examples use LOC_Os; ZS97 IDs start with OsZS; MH63 IDs start with OsMH. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/genes/batch' \
-H 'Content-Type: application/json' \
-d '{"gene_ids":["LOC_Os05g32860","LOC_Os01g01010"]}'
Response Sample
{
"ok": true,
"data": {
"results": [
{
"gene_id": "LOC_Os05g32860",
"transcript_id": "LOC_Os05g32860.1",
"reference": "NIP",
"chr": "chr05",
"start": 19240767,
"end": 19241433,
"strand": "+",
"note": "expressed protein"
}
],
"count": 1,
"used_genes": ["LOC_Os05g32860"],
"not_found": []
},
"meta": {"api_version": "v3"},
"error": null
}
POST /coordinates/convert/batch
| JSON field | Required | Type | Description |
var_ids | Yes | array | Variant IDs to convert through the coordinate-conversion cache. Maximum: 500 IDs. |
cache_only | No | boolean | Only true is currently supported. Default: true. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/coordinates/convert/batch' \
-H 'Content-Type: application/json' \
-d '{"var_ids":["vg0100001306","vg0701959554"],"cache_only":true}'
Response Sample
{
"ok": true,
"data": {
"results": [
{
"var_id": "vg0100001306",
"reference": "NIP",
"source_genome": "nip",
"rows": [
{"window_label": "Up 100bp", "nip_id": "vg0100001306", "zs_id": "vm0100005869", "mh_id": "NA"}
]
}
],
"count": 1,
"used_variants": ["vg0100001306"],
"not_found": [],
"cache_only": true
},
"meta": {"api_version": "v3"},
"error": null
}
POST /primers/by-id
| JSON field | Required | Type | Description |
var_id | Yes | string | Variant ID for primer design. |
up | No | integer | Upstream window size. Default: 100. Range: 0-10000. |
down | No | integer | Downstream window size. Default: 100. Range: 0-10000. up + down must be <= 20000. |
product_size_range | No | string | Comma-separated ranges such as 100-300,300-600,600-1000. Default: 100-300,300-600,600-1000. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/primers/by-id' \
-H 'Content-Type: application/json' \
-d '{"var_id":"vg0701959554","up":100,"down":100,"product_size_range":"100-300,300-600,600-1000"}'
Response Sample
{
"ok": true,
"data": {
"var_id": "vg0701959554",
"reference": "NIP",
"chr": "chr07",
"start": 1959454,
"end": 1959654,
"target": "100,1",
"excluded_count": 4,
"variant": {
"var_id": "vg0701959554",
"reference": "NIP",
"chr": "chr07",
"pos": 1959554,
"type": "SNP",
"ref": "T",
"alt": "G"
},
"primers": [
{
"index": 0,
"left": {"sequence": "CCACAGTTTGGGTTGGATGG", "start": 1959499, "length": 20, "tm": "59.032"},
"right": {"sequence": "GCCCAAACTCATCGACTGAC", "start": 1959639, "length": 20, "tm": "58.920"},
"product_size": "141"
}
]
},
"meta": {"api_version": "v3"},
"error": null
}
POST /genotypes/query
| JSON field | Required | Type | Description |
var_ids | Yes | array | NIP vg variant IDs. Maximum: 200 IDs. STR, ZS97, and MH63 genotype queries are not supported yet. |
cultivars | Yes | array | Cultivar IDs such as B001 or C145. Maximum: 200 IDs. The request matrix var_ids * cultivars must be <= 20000. |
Request Example
curl -s -X POST 'https://ricevarmap.ncpgr.cn/v3/api/genotypes/query' \
-H 'Content-Type: application/json' \
-d '{"var_ids":["vg0100001306"],"cultivars":["B001","C145"]}'
Response Sample
{
"ok": true,
"data": {
"results": [
{
"variant": {
"var_id": "vg0100001306",
"reference": "NIP",
"chr": "chr01",
"pos": 1306,
"type": "SNP",
"ref": "G",
"alt": "A",
"major_genotype": "G",
"minor_genotype": "A"
},
"genotypes": {
"B001": {"imputed": "G", "raw": "G"},
"C145": {"imputed": "G", "raw": "G"}
}
}
],
"count": 1,
"used_variants": ["vg0100001306"],
"not_found": []
},
"meta": {"api_version": "v3"},
"error": null
}
API Reference
{
"ok": true,
"data": {},
"meta": {
"api_version": "v3"
},
"error": null
}
{
"ok": false,
"data": null,
"meta": {
"api_version": "v3"
},
"error": {
"code": "INVALID_PARAMETER",
"message": "Invalid parameter."
}
}
Error Codes
| Code | HTTP | Meaning |
METHOD_NOT_ALLOWED | 405 | The endpoint was called with the wrong HTTP method. |
MISSING_PARAMETER | 400 | A required path, query, or JSON field is missing. |
INVALID_PARAMETER | 400 | A parameter has the wrong type, range, or format. |
INVALID_CHROM | 400 | Chromosome must be chr01 through chr12. |
INVALID_REFERENCE | 400 | Reference must be NIP, ZS97, or MH63. |
INVALID_POPULATION | 400 | Population must be one of the supported RiceVarMap population codes. |
INVALID_VARIANT_ID | 400 | Variant ID does not match a supported RiceVarMap v3 ID format. |
INVALID_GENE_ID | 400 | Gene ID contains unsupported characters. |
UNSUPPORTED_INCLUDE | 400 | include contains a section that is not supported. |
LIMIT_TOO_LARGE | 400 | limit is greater than 1000. |
REGION_TOO_LARGE | 400 | The requested interval is larger than 100000 bp. |
REQUEST_TOO_LARGE | 413 | POST body is larger than 1 MB. |
UNSUPPORTED_VARIANT_TYPE | 400 | The requested variant type or genotype mode is not currently supported. |
NOT_FOUND | 404 | The requested variant, gene, sequence interval, or genotype record was not found. |
CACHE_MISS | 404 | No coordinate-conversion cache record is available for the variant. |
INTERNAL_ERROR | 500 | An unexpected server-side error occurred. |
Request Limits
These limits are enforced to keep interactive queries responsive and to protect shared server resources.
Split larger jobs into multiple requests or use project-specific offline workflows for heavy analyses.
| Item | Limit |
| Pagination | limit defaults to 100 and must be <= 1000. offset defaults to 0. |
| Cultivar batch query | Maximum 500 cultivars per /cultivars/batch request. |
| Variant batch query | Maximum 500 var_ids for basic-only /variants/batch requests; maximum 200 when frequency is included. |
| Gene batch query | Maximum 200 gene_ids per /genes/batch request. |
| Coordinate batch query | Maximum 500 var_ids per /coordinates/convert/batch request. |
| Region interval | end must be greater than start; interval length must be <= 100000 bp. |
| Chromosomes | chr01 through chr12. |
| Gene flank sizes | up and down are 0-10000. |
| Primer window | up and down are 0-10000, and up + down must be <= 20000. |
| Genotype query size | Maximum 200 var_ids, 200 cultivars, and var_ids * cultivars <= 20000 per request. |
| POST body | Maximum 1 MB. |
| Cultivar search and filters | q, subpopulation, and location must be 100 characters or fewer. |
| Gene search | q is required and must be 100 characters or fewer. |
| STR support | STR region and detail queries are available for NIP only. |
| Genotype support | The genotype endpoint currently supports NIP vg IDs only. |
Python Example
import requests
BASE = "https://ricevarmap.ncpgr.cn/v3/api"
# GET example: search variants in a genomic region.
get_response = requests.get(
f"{BASE}/variants/by-region",
params={
"reference": "NIP",
"chr": "chr01",
"start": 10000,
"end": 20000,
"limit": 10,
},
timeout=30,
)
get_response.raise_for_status()
print(get_response.json()["data"]["variants"])
# POST example: query multiple variants by ID.
post_response = requests.post(
f"{BASE}/variants/batch",
json={
"var_ids": ["vg0100001306", "vg0701959554"],
"include": ["basic", "frequency"],
"population": "All",
},
timeout=30,
)
post_response.raise_for_status()
print(post_response.json()["data"]["results"])
R Example
library(httr)
library(jsonlite)
base <- "https://ricevarmap.ncpgr.cn/v3/api"
res <- GET(
paste0(base, "/variants/by-region"),
query = list(reference = "NIP", chr = "chr01", start = 10000, end = 20000, limit = 10)
)
stop_for_status(res)
data <- fromJSON(content(res, as = "text", encoding = "UTF-8"))
print(data$data$variants)
res <- GET(
paste0(base, "/genes/search"),
query = list(reference = "NIP", q = "LOC_Os05g32860", limit = 5)
)
stop_for_status(res)
data <- fromJSON(content(res, as = "text", encoding = "UTF-8"))
print(data$data$genes)
res <- POST(
paste0(base, "/variants/batch"),
body = list(
var_ids = list("vg0100001306", "vg0701959554"),
include = list("basic", "frequency"),
population = "All"
),
encode = "json"
)
stop_for_status(res)
data <- fromJSON(content(res, as = "text", encoding = "UTF-8"))
print(data$data$results)
res <- POST(
paste0(base, "/genotypes/query"),
body = list(var_ids = list("vg0100001306"), cultivars = list("B001", "C145")),
encode = "json"
)
stop_for_status(res)
data <- fromJSON(content(res, as = "text", encoding = "UTF-8"))
print(data$data$results)
IDs and References
| Reference | Label | Variant prefix | STR |
NIP | Nipponbare / IRGSP-1.0 | vg | Yes |
ZS97 | ZS97RS3 | vz | No |
MH63 | MH63RS3 | vm | No |
- Variant IDs follow
vg|vz|vm + chromosome + 8-digit position, for example vg0100001306.
- STR IDs use
STR + chromosome + 8-digit position, for example STR0100000001.
- Gene IDs starting with
OsZS are treated as ZS97, IDs starting with OsMH are treated as MH63, and other gene IDs are treated as NIP.
- Population codes include
All, Ind_All, Jap_All, Aus, IndI, IndII, IndIII, TeJ, TrJ, VI, Admix, Ind_Admix, and Jap_Admix.