{"openapi":"3.1.0","info":{"title":"XY:REF Agent API","version":"1.0.0","description":"Look up NSW planning data for an address. Each value has its source. A new address in a billing month costs A$0.20. Documentation: https://www.xyref.com/api-docs"},"servers":[{"url":"https://www.xyref.com/api"}],"security":[{"apiKey":[]}],"paths":{"/v1/resolve":{"get":{"operationId":"matchAddress","summary":"Match an address. Free.","description":"Use this before a lookup. Check the method, confidence and flags.","parameters":[{"name":"address","in":"query","required":true,"description":"Street number, street, suburb, state and postcode.","schema":{"type":"string","minLength":4},"example":"7 Webb Street North Parramatta NSW 2151"}],"responses":{"200":{"description":"The matched address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Match"}}}},"400":{"description":"The address is missing or too short.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The address did not match. Not charged. Check candidates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many calls. Wait, then try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/site":{"get":{"operationId":"lookUpSite","summary":"Look up every source. Can charge A$0.20.","description":"The same address counts once in a billing month. NSW only.","parameters":[{"name":"address","in":"query","required":true,"description":"Street number, street, suburb, state and postcode.","schema":{"type":"string","minLength":4},"example":"7 Webb Street North Parramatta NSW 2151"}],"responses":{"200":{"description":"The lookup. Check ok and errors in each result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteResponse"}}}},"400":{"description":"The address is missing or too short.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The address did not match. Not charged. Check candidates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The address is outside NSW. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many calls. Wait, then try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/site/{source}":{"get":{"operationId":"lookUpSource","summary":"Look up one source. Can charge A$0.20.","description":"The same address counts once in a billing month, for any number of sources. NSW only.","parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string","enum":["market","planning","flood","parcel","seed","fuel","transport","devactivity","datracker","grid","imagery","mapviews","terrain","get-the-rest"]}},{"name":"address","in":"query","required":true,"description":"Street number, street, suburb, state and postcode.","schema":{"type":"string","minLength":4},"example":"7 Webb Street North Parramatta NSW 2151"}],"responses":{"200":{"description":"The lookup. Check ok and errors in each result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteResponse"}}}},"400":{"description":"The address is missing or too short.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The address did not match, or the source does not exist. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The address is outside NSW. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many calls. Wait, then try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sources":{"get":{"operationId":"listSources","summary":"List the sources. Free, and no key is necessary.","security":[],"responses":{"200":{"description":"The sources.","content":{"application/json":{"schema":{"type":"object","required":["sources"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string"},"title":{"type":"string"}}}}}}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"candidates":{"type":"array","items":{"type":"object"}},"sources":{"type":"array","items":{"type":"string"},"description":"The source ids that exist, when the source id is wrong."}}},"Resolution":{"type":"object","properties":{"method":{"type":"string"},"confidence":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"precision":{"type":"string"}}},"Match":{"type":"object","properties":{"address":{"type":"string"},"state":{"type":"string"},"suburb":{"type":["string","null"]},"postcode":{"type":["string","null"]},"lat":{"type":"number"},"lon":{"type":"number"},"propId":{"type":["number","null"]},"gurasid":{"type":["number","null"]},"method":{"type":"string"},"confidence":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"precision":{"type":"string"},"billed":{"type":"object","properties":{"charged":{"type":"boolean"},"reason":{"type":"string"}}}}},"Field":{"type":"object","required":["value","provenance","confidence"],"properties":{"value":{"description":"Any JSON type. The type depends on the field."},"provenance":{"type":"object","required":["source","url","retrieved_at"],"properties":{"source":{"type":"string"},"url":{"type":"string"},"retrieved_at":{"type":"string","format":"date-time"},"licence":{"type":"string"},"method":{"type":"string"},"note":{"type":"string"}}},"confidence":{"type":"string","enum":["authoritative","derived","approximate"]},"clause":{"type":"string"}}},"SourceResult":{"type":"object","required":["id","ok","fields"],"properties":{"id":{"type":"string"},"ok":{"type":"boolean"},"elapsed_ms":{"type":"number"},"fields":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Field"}},"errors":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object"}}}},"SiteResponse":{"type":"object","required":["site","generated_at","resolution","results","billed"],"properties":{"site":{"type":"object"},"generated_at":{"type":"string","format":"date-time"},"resolution":{"$ref":"#/components/schemas/Resolution"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SourceResult"}},"billed":{"type":"object","properties":{"charged":{"type":"boolean"},"rate_aud":{"type":"number"},"addresses_used":{"type":"number"},"address_cap":{"type":["number","null"]},"reason":{"type":"string"},"credit_remaining_aud":{"type":"number"}}}}}}}}