ProEye-X API

Read and write work-analysis data in your company instance (https://company.proeye-x.com) from external systems such as MES, ERP or BI. Every call is JSON-RPC 2.0, sent as POST to a single endpoint: /jsonrpc.

Getting started

Endpoint

The address is different for each company instance. The database name is the first part of your company address (company).

POST https://company.proeye-x.com/jsonrpc

Create an API key

Sign in to your instance → user menu (top right) › My Profile (Preferences) › Account Security › “New API Key”. Use the key instead of your password; it is shown only once. Keep keys in server-side programs, never in browser code.

Authenticate (get uid)

Exchange your login email and API key for a user id (uid), then send DB, uid and API key with every call.

curl
curl -s https://company.proeye-x.com/jsonrpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "call", "params": {
        "service": "common", "method": "authenticate",
        "args": ["company", "you@company.com", "YOUR_API_KEY", {}]}}'

# → {"jsonrpc": "2.0", "id": null, "result": 7}      (7 = uid)

Python helper

The examples below use this helper function model().

Python
import requests

URL = "https://company.proeye-x.com/jsonrpc"
DB, LOGIN, KEY = "company", "you@company.com", "YOUR_API_KEY"

def call(service, method, *args):
    r = requests.post(URL, json={"jsonrpc": "2.0", "method": "call",
                                 "params": {"service": service, "method": method, "args": args}}, timeout=30)
    r.raise_for_status()
    body = r.json()
    if body.get("error"):
        raise RuntimeError(body["error"]["data"]["message"])
    return body.get("result")          # no "result" key when the method returns nothing

UID = call("common", "authenticate", DB, LOGIN, KEY, {})

def model(name, method, args, kw=None):
    return call("object", "execute_kw", DB, UID, KEY, name, method, args, kw or {})

Language

Pass lang in context to receive work names and element names in that language (when translated). Example: {"context": {"lang": "en_US"}} · ja_JP · zh_CN · zh_TW · vi_VN · th_TH · id_ID · es_ES · de_DE · ko_KR.

Errors

On failure you get HTTP 200 with an "error" object; error.data.message explains why (no access rights, missing required field, …).

API list

element_type is the key of a work-type slot (va = slot 1, nva = slot 2, wait = slot 3, custom slots c4 …). VA/NVA time comes from the segment_data intervals.

1. List analyses

Model · wa.sessionMethod · search_read

Returns work analyses (sessions) with average cycle time, VA ratio and number of elements.

Python
rows = model("wa.session", "search_read", [[]], {
    "fields": ["o_no", "name", "process_name", "cycle_time_avg", "va_ratio", "element_count"],
    "order": "date desc", "limit": 20,
    "context": {"lang": "en_US"},       # names in English (optional)
})
curl
curl -s https://company.proeye-x.com/jsonrpc -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0", "method": "call", "params": {"service": "object", "method": "execute_kw",
  "args": ["company", 7, "YOUR_API_KEY", "wa.session", "search_read", [[]],
           {"fields": ["o_no", "name", "cycle_time_avg", "va_ratio"], "limit": 20}]}}'
Sample response
[{"id": 6, "o_no": "O-ENG-NOVICE-01", "name": "Engine Assembly - Novice",
  "process_name": "Engine Assembly Work", "cycle_time_avg": 165.33, "va_ratio": 63.7, "element_count": 14}]

2. Get work elements

Model · wa.elementMethod · search_read

Returns the work elements of one analysis by cycle: start/end time (s), standard time, VA and NVA time. cycle_no is the cycle the element belongs to (1, 2, 3 …).

Python
elements = model("wa.element", "search_read",
    [[["session_id", "=", 6], ["cycle_no", "=", 1]]],
    {"fields": ["cycle_no", "sequence", "name", "element_type", "video_start_time", "video_end_time",
                "standard_time", "va_time", "nva_time"], "order": "cycle_no, sequence"})
# every cycle: drop the ["cycle_no", "=", 1] condition — cycle_no tells which cycle each element belongs to
Sample response
[{"id": 70, "cycle_no": 1, "sequence": 1, "name": "Fetch the tools and prepare.", "element_type": "wait",
  "video_start_time": 189.656, "video_end_time": 198.398, "standard_time": 8.742,
  "va_time": 4.104, "nva_time": 4.638}, ...]

3. Get LOSS entries

Model · wa.elementMethod · search_read (LOSS)

Returns what was entered in the LOSS tab. For every NVA segment of an element (segment_data items with type = nva), the LOSS text (loss_data) and waste type code (loss_type_data) are stored as JSON arrays in the same order — pair them as below to get rows of cycle · element · segment time · waste type · LOSS text.

Python
import json

rows = model("wa.element", "search_read", [[["session_id", "=", session_id]]],
             {"fields": ["cycle_no", "sequence", "name", "segment_data", "loss_data", "loss_type_data"],
              "order": "cycle_no, sequence"})
losses = []
for e in rows:
    nva = [s for s in json.loads(e["segment_data"] or "[]") if s["type"] == "nva"]
    notes = json.loads(e["loss_data"] or "[]")          # LOSS text, one per NVA segment
    types = json.loads(e["loss_type_data"] or "[]")     # waste type code, one per NVA segment
    for i, seg in enumerate(nva):
        losses.append({"cycle_no": e["cycle_no"], "element": e["name"],
                       "start": seg["start"], "end": seg["end"], "dur": seg["dur"],
                       "loss_type": types[i] if i < len(types) else "",
                       "loss": notes[i] if i < len(notes) else ""})
Sample response
# rows (raw)
[{"id": 207, "cycle_no": 1, "sequence": 1, "name": "Fasten bolt",
  "segment_data": "[{\"type\": \"va\", \"start\": 4.2, \"end\": 7.0, \"dur\": 2.8}, {\"type\": \"nva\", \"start\": 7.0, ...}]",
  "loss_data": "[\"Searching for the wrench\", \"Waiting for the jig\"]",
  "loss_type_data": "[\"w6\", \"w2\"]"}]

# losses
[{"cycle_no": 1, "element": "Fasten bolt", "start": 7.0, "end": 9.1, "dur": 2.1, "loss_type": "w6", "loss": "Searching for the wrench"},
 {"cycle_no": 1, "element": "Fasten bolt", "start": 11.0, "end": 12.6, "dur": 1.6, "loss_type": "w2", "loss": "Waiting for the jig"}]

# loss_type: w1 overproduction · w2 waiting · w3 transport · w4 over-processing · w5 inventory · w6 motion · w7 defects

4. Create an analysis

Model · wa.sessionMethod · create

Creates a new work analysis. O-No (a unique number) is required and must not repeat. Returns the new ID.

Python
session_id = model("wa.session", "create", [{
    "o_no": "O-2026-LINE3-01",          # required, unique
    "name": "Line 3 sub-assembly",
    "process_name": "Sub-assembly",
}])
Sample response
21

5. Add work elements

Model · wa.elementMethod · create

Adds several elements at once by video time range. Totals such as cycle time and VA ratio are recalculated automatically.

Python
ids = model("wa.element", "create", [[
    {"session_id": session_id, "cycle_no": 1, "sequence": 1, "name": "Pick part",
     "element_type": "va", "video_start_time": 0.0, "video_end_time": 4.2},
    {"session_id": session_id, "cycle_no": 1, "sequence": 2, "name": "Fasten bolt",
     "element_type": "va", "video_start_time": 4.2, "video_end_time": 9.8},
]])
summary = model("wa.session", "read", [[session_id]],
                {"fields": ["element_count", "cycle_time_avg", "va_ratio"]})
Sample response
[205, 206]
[{"id": 18, "element_count": 2, "cycle_time_avg": 9.8, "va_ratio": 100.0}]

6. Update / delete an element

Model · wa.elementMethod · write / unlink

Change the name, times or work type (write), or delete it (unlink).

Python
model("wa.element", "write", [[205], {"name": "Pick and place", "video_end_time": 4.6}])
model("wa.element", "unlink", [[206]])
Sample response
true
true

7. Write LOSS entries

Model · wa.elementMethod · write (LOSS)

Writes the LOSS text and waste type code for each NVA segment as JSON arrays in time order. The n-th value belongs to the n-th NVA segment. Waste codes: w1 overproduction · w2 waiting · w3 transport · w4 over-processing · w5 inventory · w6 motion · w7 defects.

Python
import json

# element with NVA segments 7.0–9.1 s and 11.0–12.6 s → one entry per NVA segment, in time order
model("wa.element", "write", [[207], {
    "loss_data": json.dumps(["Searching for the wrench", "Waiting for the jig"]),
    "loss_type_data": json.dumps(["w6", "w2"]),
}])
Sample response
true

8. Get cycles

Model · wa.cycleMethod · search_read

Returns the measured cycles with start, end and cycle time.

Python
cycles = model("wa.cycle", "search_read", [[["session_id", "=", 4]]],
               {"fields": ["sequence", "video_start", "video_end", "cycle_time"], "order": "sequence"})
Sample response
[{"id": 4, "sequence": 1, "video_start": 0.767, "video_end": 17.15, "cycle_time": 16.383}, ...]

9. Comparison (before / after)

Model · wa.comparisonMethod · create · action_build_lines · read

Pairs two analyses as a comparison, builds the comparison lines and returns the cycle-time reduction, VA improvement and per-element differences.

Python
cid = model("wa.comparison", "create", [{
    "name": "Line 1 before / after", "session_a_id": 7, "session_b_id": 11}])
model("wa.comparison", "action_build_lines", [[cid]])
result = model("wa.comparison", "read", [[cid]],
               {"fields": ["ct_a", "ct_b", "ct_reduction", "ct_reduction_pct", "va_improvement"]})
lines = model("wa.comparison.line", "search_read", [[["comparison_id", "=", cid]]],
              {"fields": ["sequence", "step_name", "time_a", "time_b", "time_diff"], "order": "sequence"})
Sample response
[{"id": 3, "ct_a": 22.72, "ct_b": 23.39, "ct_reduction": -0.67, "ct_reduction_pct": -2.9, "va_improvement": -6.4}]
[{"id": 49, "sequence": 1, "step_name": "UP", "time_a": 2.85, "time_b": 2.723, "time_diff": -0.127}, ...]

10. Line balancing

Model · wa.linebalance · wa.lb.processMethod · search_read

Returns takt time, line efficiency, the bottleneck process, and each process’s cycle time and load.

Python
lines = model("wa.linebalance", "search_read", [[]],
              {"fields": ["name", "takt_time", "lb_efficiency", "bottleneck_name", "max_ct"]})
processes = model("wa.lb.process", "search_read", [[["lb_id", "=", lines[0]["id"]]]],
                  {"fields": ["sequence", "process_name", "cycle_time", "load_ratio", "over_takt"],
                   "order": "sequence"})
Sample response
[{"id": 1, "name": "LB_Robot Assembly Line MAC Analysis", "takt_time": 27.74,
  "lb_efficiency": 90.0, "bottleneck_name": "Robot Assembly Line (After Improvement)", "max_ct": 27.74}]
[{"id": 1, "sequence": 10, "process_name": "Robot Assembly Line (After Improvement)",
  "cycle_time": 23.39, "load_ratio": 84.3, "over_takt": false}, ...]

11. MMC · MAC

Model · wa.mmc · wa.macMethod · search_read

Returns man-machine charts (MMC) and multi-activity charts (MAC) with time breakdown and utilization.

Python
mmc = model("wa.mmc", "search_read", [[]],
            {"fields": ["name", "total_time", "machine_time", "walk_time", "wait_time", "load_ratio"]})
mac = model("wa.mac", "search_read", [[]],
            {"fields": ["name", "process_count", "takt_time", "avg_ct", "utilization", "balance_eff"]})
Sample response
[{"id": 1, "name": "Engine Assembly Line", "total_time": 165.33, "machine_time": 0.0,
  "walk_time": 0.0, "wait_time": 0.0, "load_ratio": 100.0}]
[{"id": 1, "name": "Robot Assembly Line MAC Analysis", "process_count": 4, "takt_time": 0.0,
  "avg_ct": 24.97, "utilization": 0.0, "balance_eff": 90.0}]

List every field with fields_get: model("wa.session", "fields_get", [], {"attributes": ["string", "type"]})