Responses

All requests will be replied to with a JSON or XML string containing the documented variables for each method.

All JSON responses will contain a dictionary with keys while XML will contain elements under the root.

Key Description
status String containing one of ok, warn, fail.
method String containing the name of the method that was called.
error List of error strings, describing any errors if status is set to warn or fail.
result List of response numbers, strings or response dictionaries.

result is a list of dictionaries containing multiple keys for a search call:

Key Description
filepath The collection image’s file path.
score How closely the query image matches the collection image.
query_overlap_percent How much the query image overlaps the collection image, as a percentage.
target_overlap_percent How much the collection image overlaps the query image, as a percentage.
overlay A URL pointing to the overlay for a search.

Example response to a search request

JSON

{
    "status": "ok",
    "error": [],
    "method": "search",
    "result": [
        {
            "score": 100,
            "target_overlap_percent": 100,
            "match_percent": 100,
            "overlay": "overlay/?query=example2.jpg&target=example2.jpg&m21=-2.92719e-05&m22=0.999936&m23=0.012885&m11=0.999936&m13=0.014596&m12=2.92719e-05",
            "query_overlap_percent": 99.99,
            "filepath": "example2.jpg"
        },
        {
            "score": 20.20,
            "target_overlap_percent": 83.59,
            "match_percent": 29.22,
            "overlay": "overlay/?query=example2.jpg&target=example3.jpg&m21=0.0369254&m22=1.04451&m23=-11.8512&m11=1.04451&m13=-20.9172&m12=-0.0369254",
            "query_overlap_percent": 68.43,
            "filepath": "example3.jpg"
        }
    ]
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <error/>
    <method>search</method>
    <result>
        <item>
            <filepath>example2.jpg</filepath>
            <match_percent>100.0</match_percent>
            <overlay>overlay/?query=example2.jpg&amp;target=example2.jpg&amp;m21=-2.92719e-05&amp;m22=0.999936&amp;m23=0.012885&amp;m11=0.999936&amp;m13=0.014596&amp;m12=2.92719e-05</overlay>
            <query_overlap_percent>99.99</query_overlap_percent>
            <score>100.0</score>
            <target_overlap_percent>100.0</target_overlap_percent>
        </item>
        <item>
            <filepath>example3.jpg</filepath>
            <match_percent>29.22</match_percent>
            <overlay>overlay/?query=example2.jpg&amp;target=example3.jpg&amp;m21=0.0369254&amp;m22=1.04451&amp;m23=-11.8512&amp;m11=1.04451&amp;m13=-20.9172&amp;m12=-0.0369254</overlay>
            <query_overlap_percent>68.43</query_overlap_percent>
            <score>20.20</score>
            <target_overlap_percent>83.59</target_overlap_percent>
        </item>
    </result>
    <status>ok</status>
</data>