API
API documentation
API end points
This website has it's own API server. Below is a partial brief of how it works.
Get all Documents
By default you will get 20 documents. You can define the amount of results and the offset (see more below).
https://pet-scraper.onrender.com/api/animals/
Filter by Sex
You can filter out your results by sex. The ":sex" parameter accepts "male" and "female".
https://pet-scraper.onrender.com/api/animals/sex/:sex
Search by Breed
You can submit a GET request with your "SEARCH_TEXT" as the value for the "breed" query parameter.
https://pet-scraper.onrender.com/api/search?breed=SEARCH_TEXT
Results
If "size" and "offset" are not specified, by default you will get the first 20 documents. Below is an example setting size to 20 and offset to 60.
{
"total" : 64,
"pages" : 4,
"size" : 20,
"offset" : 60,
"count" : 4,
"results" : [{Animal.Documents},...]
}
- In this example, there are 64 total results.
- Because the offset is 60 and there are only 4 documents remaining. Hence, "count" is 4.
- The "pages" parameter is equal to ( total results / size ). In case you need pagination :).
Animal Documents
Here is how the Animal documents look like.
{
"imgs" : [String],
"status" : String,
"_id" : String,
"petURI" : String,
"domain" : String,
"petId" : String,
"age" : String,
"breed" : String,
"sex" : String,
"name" : String,
}
Description
- "imgs" : An Array of Strings. This are links to the animal images
- "status" : You will only get "Active". The app runs every day and 'deactivates' any animals that are no longer active on origin site
- "_id" : The document ID
- "petURI" : The URI to the animal's profile in the origin site
- "domain" : The URI to the origin site
- "petId" : The ID of the animal in the origin site
- "age" : The animal age. Descriptions change from site to site so this can look like "Young" or "3"
- "breed" : The animal's breed
- "sex" : The animal's sex
- "name" : The animal's name