Skip to Content
API ReferenceQuery and Path Params

Query and Path Params

Authentication Header

Authorization: Bearer <KOJI_SECRET>

  • Required only when server env KOJI_SECRET is set.
  • Ignored if session-authenticated in UI context.

Return Type Values

These values are accepted in path /{return_type} and in body return_type/query rt.

ValueOutput
alt_textText with lat lon,lat lon style
textText with lat,lon lines
arrayUses single or multi array based on inferred default
single_array[[lat, lon], ...]
multi_array[[[lat, lon], ...], ...]
structUses single or multi struct based on inferred default
single_struct[{"lat":...,"lon":...}]
multi_struct[[{"lat":...,"lon":...}]]
geometryGeoJSON geometry (or list if multiple features)
geometry_vecList of GeoJSON geometries
featureGeoJSON feature (or list if multiple features)
feature_vecList of GeoJSON features
feature_collectionGeoJSON FeatureCollection
poraclePoracle format
sqlSQL predicate text

Aliases accepted by server include camel/compact versions (example: featurecollection, geometryvec).

Geofence Query Params (ApiQueryArgs)

Used by:

  • GET /api/v1/geofence/all
  • GET /api/v1/geofence/area/{geofence}
  • GET /api/v1/geofence/{return_type}
  • GET /api/v1/geofence/{return_type}/{project}

Visibility and shape

ParamTypePurpose
internalbooleanInclude internal __ properties and generated ids.
idbooleanInclude id property.
namebooleanInclude name property.
modebooleanInclude mode property.
geofence_idbooleanInclude geofence_id property.
parentbooleanInclude parent property.
rtstringReturn type override.
groupbooleanSet group from parent.
fullcoordsbooleanKeep full floating-point precision.

Name manipulation

Applied in server order to the name property:

ignoremanualparent -> trimstart -> trimend -> alphanumeric -> replace -> parentreplace -> parentstart -> parentend -> lowercase -> uppercase -> capfirst -> capitalize -> underscore -> dash -> space -> unpolish -> final trim.

Examples assume name="North, NY" and parent="NY" unless stated otherwise.

ParamTypePurposeExample
lowercasebooleanForce lowercase name.lowercase=true -> north, ny
uppercasebooleanForce uppercase name.uppercase=true -> NORTH, NY
capitalizestringCapitalize words split by provided separator.capitalize="_" on north_ny -> North_Ny
capfirstbooleanCapitalize first character only.capfirst=true on north, ny -> North, ny
parentstartstringPrefix name with parent joined by string.parentstart=" - " -> NY - North, NY
parentendstringSuffix name with parent joined by string.parentend=" - " -> North, NY - NY
parentreplacestringReplace parent substring in name with string.parentreplace="" -> North,
spacestringReplace spaces with string.space="_" -> North,_NY
underscorestringReplace underscores with string.underscore=" " on North_NY -> North NY
dashstringReplace dashes with string.dash=" " on North-NY -> North NY
replacestringRemove occurrences of substring.replace="," -> North NY
trimstartintegerTrim N chars from start.trimstart=7 -> NY
trimendintegerTrim N chars from end.trimend=4 -> North
unpolishbooleanConvert Polish chars to ASCII.unpolish=true on Łódź -> Lodz
ignoremanualparentbooleanIgnore manual parent property.ignoremanualparent=true uses DB parent over manual override.
alphanumericbooleanRemove non-alphanumeric chars except spaces/dash/underscore.alphanumeric=true on North, NY! -> North NY

Filtering

ParamTypePurpose
excludepropertiesstringComma-separated property keys to exclude.
excludeparentsstringComma-separated parent names to exclude.
excludestringComma-separated names to exclude.

Route Query Params

Used by route endpoints:

  • GET /api/v1/route/all
  • GET /api/v1/route/area/{id}
  • GET /api/v1/route/{return_type}
  • GET /api/v1/route/{return_type}/{geofence_name}
ParamTypePurpose
internalbooleanInclude internal fields in route responses.
rtstringReturn type override (only used by /route/area/{id}).

Path Params

EndpointParamTypeNotes
/api/v1/geofence/area/{geofence}geofencestringGeofence id/name lookup.
/api/v1/geofence/reference/{project}projectstringProject name/id used by DB query.
/api/v1/geofence/{return_type}return_typestringSee return type table.
/api/v1/geofence/{return_type}/{project}return_type, projectstringReturn format + project filter.
/api/v1/geofence/push/{id}idstringGeofence id to push to scanner/controller DB.
/api/v1/route/area/{id}idstringRoute id/name lookup.
/api/v1/route/reference/{geofence}geofencestringGeofence name filter.
/api/v1/route/{return_type}return_typestringSee return type table.
/api/v1/route/{return_type}/{geofence_name}return_type, geofence_namestringReturn format + geofence filter.
/api/v1/route/push/{id}idintegerNumeric Koji route id.
/api/v1/project/push/{id}idstringProject id/name in Koji DB.
/api/v1/calc/{mode}/{category}mode, categorystringcategory: gym, pokestop, spawnpoint, fort.
/api/v1/calc/route-stats/{category}categorystringSame category rules as above.
/api/v1/s2/{cell_level}cell_levelintegerS2 cell level to generate.
Last updated on