Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Landrace.Wiki:API

From Landrace.Wiki - The Landrace Cannabis Wiki
ℹ️
This is a project information page for Landrace.Wiki. It describes the project's standards, processes, or structure. It is not an encyclopaedic article.

Landrace.wiki provides a public, read-only HTTP API for programmatic access to the encyclopedia and the accession database. The API is anonymous, requires no authentication for read operations, and returns JSON. It is the primary machine-readable entry point to the project's structured data.

This page documents the endpoints most likely to be useful to third-party developers, researchers, data journalists and automated agents. For the broader project context and editorial stance, see Landrace.Wiki:About and the curated agent entry point at https://landrace.wiki/llms.txt.

Endpoints

Semantic query (askargs)

The primary endpoint is the Semantic MediaWiki askargs action. It accepts category and property conditions and returns structured JSON for any subset of pages matching the query.

Base URL: https://landrace.wiki/api.php

Minimal accession query

https://landrace.wiki/api.php?action=askargs
  &conditions=Category:Accessions
  &printouts=Has%20descriptive%20name
  &parameters=limit%3D10
  &format=json

Returns the first ten accession pages with their descriptive names.

Multiple printouts

https://landrace.wiki/api.php?action=askargs
  &conditions=Category:Accessions
  &printouts=Has%20descriptive%20name|Has%20country|Has%20collection%20year
  &parameters=limit%3D50
  &format=json

Printouts are pipe-delimited. Spaces in property names must be URL-encoded (%20).

Multiple conditions (AND)

https://landrace.wiki/api.php?action=askargs
  &conditions=Category:Accessions|Has%20country::Cambodia
  &printouts=Has%20descriptive%20name|Has%20growing%20area
  &format=json

Conditions are pipe-delimited. Property conditions use the Property::Value syntax, with the double colon URL-encoded as %3A%3A in query strings where required.

Standard MediaWiki API

The usual MediaWiki action API is also available at the same base URL. Useful actions include action=query for page content, revisions and categorymembers, and action=parse for rendered output.

Response format

Askargs responses are JSON objects with two top-level keys of interest:

  • query.results — an object keyed by page title, each entry containing a printouts object mapping property names to arrays of values
  • query.meta — total count, query time, offset

Printout values are typed. Geographic coordinates return latitude / longitude pairs, dates return ISO 8601 strings, page references return the target page title.

Common properties

The accession data model uses Semantic MediaWiki properties. The majority of accession pages are generated from a master inventory spreadsheet by an automated sync pipeline, which covers roughly sixty data fields. Coverage of any given property therefore depends on how often the corresponding field is filled in the source sheet.

The tiers below describe typical population rates across the current corpus.

Highly populated (on 80%+ of accessions)

Core identification, classification and collection metadata. Queries restricted to these properties can rely on getting values back for most accessions:

  • Has accession ID (Page)
  • Has descriptive name (Text)
  • Has classification (Text)
  • Has accession type (Text)
  • Has selection type (Text)
  • Has sexual characteristics (Text)
  • Has collection method (Text)
  • Has sourcing type (Text)
  • Has sample harvest date (Text)
  • Has collector (Page)
  • Has country (Page)
  • Has province (Page)
  • Has growing region (Page)
  • Has primary purpose (Text)
  • Has chemotype (Text)
  • Has photoperiod response (Text)
  • Has conservation priority (Text, see note below)

Moderately populated (30 to 80%)

Geographic detail, cultivation context and common botanical fields. Expect some results to be empty:

  • Has coordinates (Geographic)
  • Has elevation (Quantity)
  • Has aspect (Text)
  • Has locality (Page)
  • Has growing area (Page)
  • Has admin 2, Has admin 3, Has admin 4 (Page)
  • Has collection date (Date)
  • Has expedition ID (Text)
  • Has minimum flowering time, Has maximum flowering time (Text)
  • Has minimum height, Has maximum height (Quantity)
  • Has perceived introgression level (Text)
  • Has cultivation status (Text)
  • Has cultivation scale (Text)
  • Has cultivation system type (Text)
  • Has legal enforcement threats (Text)
  • Has observed soil type, Has soil PH (Text)
  • Has leaf shape (Text)
  • Has leaf color (Text)
  • Has branching (Text)
  • Has growth pattern (Text)
  • Has processing method (Text)
  • Has planting method (Text)
  • Has seed sourcing (Text)
  • Has male female ratio (Text)
  • Has population hermaphroditism (Text)
  • Has culling (Text)
  • Has local name, Has pronunciation, Has vernacular translation (Text)
  • Has cycle 1 earliest planting through Has cycle 1 harvest end (Text)

Sparsely populated (under 30%)

Defined and syncing but filled on a minority of accessions. Useful for targeted queries, not for broad aggregation:

  • Has appellation, Has field (Page)
  • Has farmer name (Text)
  • Has leaflet count, Has serration, Has stem color, Has stigma color, Has flower structure (Text)
  • Has aroma, Has effects (Text)
  • Has processing notes (Text)
  • Has population estimate (Number)
  • Has synonyms (Text)
  • Has related accession, Has same population accessions (Page)
  • Has mother plant ID, Has father plant ID (Page)
  • Has eradication date (Date)
  • Has cycle 2 earliest planting through Has cycle 2 harvest end (Text)

Full property list

Special:Properties lists every property defined in the wiki, with types and usage counts. This includes Tier 2 and Tier 3 documentation fields (terpene and cannabinoid percentages, photographic documentation booleans, detailed morphological measurements) that are defined for future use but currently carry zero values across the corpus. Special:UnusedProperties filters to only those.

For a live property dump on a single accession, follow the "Browse properties" link at the foot of any accession page, or navigate to Special:Browse/PAGE_NAME.

Note on Has conservation priority

This property is overloaded. On growing region pages it stores IUCN-adapted status values (Stable, Vulnerable, Endangered, Critical, Extinct, Unknown). On accession pages it stores priority tiers (Critical, High, Medium, Low). Consumers aggregating across both should filter by category first, for example by restricting a query to or .

Machine-readable metadata on accession pages

Every page in Category:Accessions emits a Schema.org Dataset JSON-LD block in the page <head>. This is complementary to the askargs API: agents that consume Schema.org metadata can extract key facts from an accession page without calling the API at all.

The JSON-LD includes:

  • @type: Dataset
  • spatialCoverage with country, growing region and coordinates
  • temporalCoverage with collection year
  • license, creator, contributor
  • keywords drawn from the page's semantic properties

A curated agent entry point at /llms.txt provides project stance, data methodology and navigation for language models and similar automated systems.

Coordinate precision

Coordinates returned by the API are published at approximately 500m precision. This is a deliberate methodology to protect farmers in prohibition jurisdictions. Raw collection coordinates are not distributed through any public interface. See Landrace.Wiki:Privacy_policy#Geographic and cultivation data for the full methodology.

Downstream systems that reproject, aggregate or visualise accession coordinates should preserve the uncertainty rather than treating the values as precise.

Licensing

Content accessed via the API is licensed under Creative Commons Attribution-ShareAlike 4.0. Attribution should cite Landrace.wiki and the Zomia Collective.

Where structured data is extracted and republished in a derivative dataset, operators of that dataset should observe CC BY-SA 4.0 obligations, including attribution and ShareAlike.

Rate limits and good citizenship

The API runs on shared hosting. A few requests per second is acceptable; sustained high-volume traffic is not. Specific conventions:

  • Cache responses locally where possible
  • Include a descriptive User-Agent header identifying the client and a contact URL or email
  • For bulk exports or ongoing synchronisation, contact privacy@landrace.wiki to discuss

Abusive patterns may be rate-limited or blocked at the hosting level without prior notice.

Stability

The askargs endpoint is part of Semantic MediaWiki's documented stable API. The property schema is versioned through ordinary wiki editing; property renames are rare but do occur. Treat a printout as a named binding rather than a fixed contract.

Breaking changes to endpoints or the property schema will be noted on this page and in the project news feed.

Further reading