API Data

From Golden Retriever Wiki

Revision as of 16:42, 22 December 2023 by Dave (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Once you have the Dictionary_no you wish to pull the data from (Use the Dictionary endpoint to find the Dictionary_no) you can use the following format to pull the data.

 curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/data/{Dictionary_no}"

Each response from the API will be in the following JSON format:

 {
   "message": "Successful",
   "skip": 0,
   "limit": 10,
   "total": 15,
   "data": []
 }

"message" will either be "Successful" or an error message. "skip" is how many records into the query we skipped, "limit" is how many objects we returned. "total" is the total amount of objects that are available. And "data" is an array of objects containing the results.