4. Advanced features
The API supports advanced feature usage, see the documentation below.You can suggest additional features in the official Discord .
4.2. Global argument
4.2.1. JSON Path
A basic knowledge of the API and JSON Path is required.
The JSON Path selector is a way to select data in the query.The root ( $ ) of the selector is the fielddata
in the response.This is based on the python-jsonpath-rw-ext , see the doc to learn how to use it.Warning
Don’t forget to encode special characters ($, +, -, *, /).
Select the handle only:
- GET / ( string: apikey ) /v1/live/user/dymerz?json_path=$.profile.display
In this example, we are fetching the data of a user nameddymerz
via thelive
source. Notice how we also have ajson_path
parameter with the value:profile.display
.This will result in selecting thedisplay
only:{ "message": "ok", "source": "live", "success": 1, "data": "[ΩP] Dymerz" }Search all unfinished tasks from the roadmap.
- GET / ( string: apikey ) /v1/live/roadmap/starcitizen?json_path=$[*].cards[?(completed=0)]
{ "message": "ok", "source": "live", "success": 1, "data": [ { "board_id": 1, "body": "Prison uniform that will be provided to incarcerated Players serving a sentence.", "category_id": 3, "category_name": "Characters", "completed": 0, "description": "Creating a uniform for Players to wear while incarcerated. ", "id": "708", "importer_id": "SC-358590", "inprogress": 0, "name": "Prison Uniform", "order": 0, "release_id": 27, "released": 0, "scheduled_at": null, "tasks": 2, "thumbnail": { "id": "1896708", "urls": { "large": "/media/cm1pcw46m27aqr/hub_large/00-Prison-Uniform.jpg", "rect": "/media/cm1pcw46m27aqr/product_thumb_large/00-Prison-Uniform.jpg", "source": "/media/cm1pcw46m27aqr/source/00-Prison-Uniform.jpg", "square": "/media/cm1pcw46m27aqr/heap_infobox/00-Prison-Uniform.jpg" } }, "time_created": 1573849305, "time_modified": 1576605345, "url_slug": "Prison-Uniform" } ] }