VarBook RemoteControl API

Read a VarBook data dictionary from your own tools (R, Python, Excel) without opening VarBook. It works like LimeSurvey's RemoteControl: sign in once with your VarBook username and password, get a session key, and call the methods below with it. The API can only read; nothing can be changed through it.

Address

checking…

  1. Call get_session_key with your VarBook username and password. You get a session key.
  2. Call any method below with that key as the first parameter. You get exactly what your VarBook account may see: the same rights as in VarBook, checked on every call.
  3. Call release_session_key at the end. A key also stops by itself after 2 hours without use.

Try it now: this address serves the public VarBook demo (NHANES 2017–2018 metadata). Use the demo account: username demo, password ViewMetaco2026. Every VarBook installation has its own address in the same form: https://<your VarBook>/api/remotecontrol.php, used with your own VarBook account.

Request and answer

Every call is an HTTP POST to the address above, with Content-Type: application/json and a JSON-RPC body. Parameters go in order in params (or by name, as an object). The answer always has result and error: one of them is null.

Request

{"method": "get_session_key",
 "params": ["your-username", "your-password"],
 "id": 1}

{"method": "search_fields",
 "params": ["<session key>", "bloeddruk", {"limit": 50}],
 "id": 2}

Answer

{"id": 1, "result": "8f3c…(32 characters)", "error": null}

{"id": 2, "result": {"query": "bloeddruk",
   "alsoSearched": ["blood pressure", …],
   "count": 57, "results": [ … ]},
 "error": null}

{"id": 3, "result": null,
 "error": "Invalid session key. …"}

Methods

"Who" is the lowest VarBook role that may call the method. sSessionKey is always the first parameter (except for get_session_key).

MethodParametersReturnsWho
Loading…

Examples

A whole session: sign in, search, look at one field, sign out. Put your password in an environment variable (METACO_USER, METACO_PASSWORD), not in the script, so you can share the script safely.


    

Good to know