Response

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 four keys while XML will contain four 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.
result List of response numbers, strings or response dictionaries.
error List of error strings, describing any errors if status is set to warn or fail.

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

Key Description
score String with relevance score.
overlay URL pointing to an image used to generate overlays.
target_overlap_percent How much the target image overlaps the query image, in percentage.
query _overlap_percent How much the query image overlaps the target image, in percentage.
filepath String with the query image’s path.

Examples for 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>