Coder Social home page Coder Social logo

petfinder-com / petfinder-go-sdk Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 38 KB

Petfinder.com API client library for Golang

Home Page: https://www.petfinder.com/developers/

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.52% Go 99.48%
petfinder-api petfinder

petfinder-go-sdk's Introduction

Petfinder.com API Client sdk for Golang

CircleCI Coverage Status Documentation

Uses Petfinder API v2.

Please see example usage in cmd/main.go

Example client usage:

//Pull Client ID key and Client Secret Key from environment variables
clientID := os.Getenv("PF_CLIENT_ID")
clientSecret := os.Getenv("PF_CLIENT_SECRET")

//Create pfclient Object
pfclient, err := pfapi.NewClient(clientID, clientSecret)
if err != nil {
    fmt.Println("Could not create client")
}

//Create variable based on AnimalType struct
var types []pfapi.AnimalType

//Retreive all animal types, put into struct
types, _ = pfclient.GetAllTypes()

//Iterate through animal types using struct data
for _, t := range types {
    fmt.Println("Name: ", t.Name)
    fmt.Println("Colors: ", t.Colors)
    fmt.Println("Self Link: ", t.Links.Self.Href)
}

petfinder-go-sdk's People

Contributors

nsdavidson avatar pftjtn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

petfinder-go-sdk's Issues

Get Dog by ID returns cropped description in response

When calling for a specific dog using the animal ID, it returns a JSON object with a description of the dog as the property. However, that description is cropped and not the full description.

response I'm getting from GO SDK for animal (dog) with ID of 48119604:

{
"ID":48119604,
"OrganizationID":"IN705",
"URL":"https://www.petfinder.com/dog/willa-48119604/in/sellersburg/inky-animal-rescue-in705/?referrer_id=875c6437-0861-418d-a7c5-810f807e902d",
"Type":"Dog",
"Species":"Dog",
"Breeds":{
"Primary":"Chihuahua",
"Secondary":"",
"Mixed":true,
"Unknown":false
},
"Colors":{
"Primary":"Bicolor",
"Secondary":"",
"Tertiary":""
},
"Age":"Young",
"Gender":"Female",
"Size":"Small",
"Coat":"Short",
"Name":"Willa",
"Description":"Willa is a chihuahua mix who spent the first two years of her life in a chicken coop, all by...",
"Photos":[
{
"Small":"https://dl5zpyw5k3jeb.cloudfront.net/photos/pets/48119604/1/?bust=1591138818\u0026width=100",
"Medium":"https://dl5zpyw5k3jeb.cloudfront.net/photos/pets/48119604/1/?bust=1591138818\u0026width=300",
"Large":"https://dl5zpyw5k3jeb.cloudfront.net/photos/pets/48119604/1/?bust=1591138818\u0026width=600",
"Full":"https://dl5zpyw5k3jeb.cloudfront.net/photos/pets/48119604/1/?bust=1591138818"
}
.....
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.