Skip to main content

Model API Models() Reference

Model API features two main queries -- models and model. The models query is essentially a search-engine, whereas the model query retrives information from a singular model - directly.

Learning to build powerful models queries can lead to efficient application design and will provide greater insights into the models in your account.

Models Schema

The models query has 5 optional parameters that will allow you to fine tune the returned data.

Leaving all of these blank will result in a list of 10 active models sorted by created_time in descending order.

query {
models(
include: [SearchInclusion!],
query: String,
sortBy: [ModelSort!],
pageSize: Int,
offset: String
): ModelSearchResultList
}
argumentrequired?defaultvalues
includenodemo, inactive
queryno** for all. ES Syntax
sortByno[{field: created_time, order: desc}]
pageSizeno101 - 1000
offsetnonullAny value returned from the nextOffset from the previous result

The results of the models() query will return totalResults, nextOffset (if totalResults > pageSize), and the results. You can use the nextOffset in a subsequent models() query.

type ModelSearchResultList {
nextOffset: String
totalResults: Int!
results: [ModelSearchResult!]
}

For a complete list of fields returned in 'results', click here

Building Powerful query strings

Any field defined in ModelSearchResult may be included as a keyword in the models query.

For example "name: Demo" would search for models with the word Demo in the name. A search for "mattertags.labels: kitchen" would search for any models that have at least one mattertag with the word kitchen in the label.

Sample Queries

Find all the models in Lawrence, KS:

query {
models (query: "address.locality:\"Lawrence\" AND address.administrativeArea: \"KS\"") {
totalResults
nextOffset
results {
id
name
}
}
}

Find all the models with at least one unplaced sweeps

query {
models (query: "assets.panoLocations.placement: \"UNPLACED\"") {
totalResults
nextOffset
results {
id
name
}
}
}

Find all the models edited since Oct 10th that have at least one measurement:

query {
models (query: "modified:[2019-10-10 TO *] AND measurements.count:[1 TO *]") {
totalResults
nextOffset
results {
id
name
}
}
}

Searchable Fields

FieldDefaultType
id*
internalId*
created*DateTime
modified*DateTime
name*Text
description*Text
visibility*public, private
demofalsetrue, false
address*Text
address.streetAddressLinesYText
address.administrativeAreaYText
address.localityYText
address.dependentLocalityYText
address.countryNameYText
address.postalCodeNKeyword
address.countryCode**Keyword
geolocationNGeo-Point
floors.countNInteger
floors.tagsYSet Keyword
rooms.countNInteger
rooms.labelYText
rooms.tagsYSet Keyword
mattertags.countNInteger
mattertags.labelYSet Text
mattertags.descriptionYSet Text
mattertags.mediaTypeYSet Keyword
measurements.countNInteger
measurements.labelYSet Text
mls.idYText
mls.nameYText
assets.panos.countNInteger
assets.panos.formatNSet Keyword
assets.panos.resolutionNSet Keyword
assets.clips.countNInteger
assets.clips.formatNSet Keyword
assets.clips.labelYSet Text
assets.photos.countNInteger
assets.photos.formatNSet Keyword
assets.photos.labelYSet Text
assets.photos.resolutionsNSet Keyword
assets.meshes.countNInteger
assets.meshes.formatNSet Keyword
assets.textures.countNInteger
assets.textures.formatNSet Keyword
assets.locations.countNInteger
assets.locations.tagsYSet Keyword
assets.panoLocations.countNInteger
assets.panoLocations.placementNSet Keyword
assets.panoLocations.variantNSet Keyword