foursquarego

package module
v4.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2018 License: MIT Imports: 5 Imported by: 0

README

Foursquarego Build Status GoDoc Go Report Card

Foursquarego is a simple Go package for accessing theFoursquare API.

If you find any errors please create an issue, the foursquare API has different types even for things with the same name.

Install

go get -u github.com/peppage/foursquarego

Usage


    httpClient := http.DefaultClient
    // When creating the client you can specify either clientSecret or the accesstoken
    client := foursquarego.NewClient(httpClient, "foursquare", "clientId", "clientSecret", "")

    // Get venue details
    venue, resp, err := client.Venues.Details("57d1efb5498e018d15de8ba3")
    
    // Search Venues
    venues, resp, err := client.Venues.Search(&VenueSearchParams{
		LatLong: "40.7,-74",
		Query:   "singlecut",
	})

License

MIT License

Documentation

Overview

Package foursquarego provides a Client for the Foursquare API.

Here are some example requests

// You will need an http client to make all the requests.
httpClient := http.DefaultClient

// When creating the client you can specify either clientSecret or the accesstoken
client := foursquarego.NewClient(httpClient, "foursquare", "clientId", "clientSecret", "")

// Venue Details
venue, resp, err := client.Venues.Details("57d1efb5498e018d15de8ba3")

// Search Venues
venues, resp, err := client.Venues.Search(&VenueSearchParams{
    LatLong: "40.7,-74",
    Query:   "singlecut",
    Intent: IntentBrowse,
})

There is a parameters struct if there is more than just 1 parameter. If there are strict options for the parameters then there will be a struct as seen in the search above.

For Authentication the just send either the Client Secret or the users's Access Token. If you send both to the client it will send both to foursquare. Foursquare expects that if you're making a request for a user you will send the Access Token. More information can be found on their auth page, https://developer.foursquare.com/docs/api/configuration/authentication

Index

Constants

View Source
const (
	True = BoolAsAnInt(1)
)

Option available for BoolAsAnInt

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Meta Meta `json:"meta"`
}

APIError is a foursquare error response https://developer.foursquare.com/docs/api/troubleshooting/errors

func (APIError) Error

func (e APIError) Error() string

type Attribute

type Attribute struct {
	Group
	Summary string          `json:"summary"`
	Items   []AttributeItem `json:"Items"`
}

Attribute contains info about Venue such as price tier, reservations and parking.

type AttributeItem

type AttributeItem struct {
	DisplayName  string `json:"displayName"`
	DisplayValue string `json:"displayValue"`
	PriceTier    int    `json:"priceTier"`
}

AttributeItem is the actual value shown in an Attribute.

type Attributes

type Attributes struct {
	Groups []Attribute `json:"groups"`
}

Attributes contains Attribute associated with a venue.

type BeenHere

type BeenHere struct {
	Count                int   `json:"count"`
	UnconfirmedCount     int   `json:"unconfirmedCount"`
	Marked               bool  `json:"marked"`
	LastVisitedAt        int64 `json:"lastVisitedAt"`
	LastCheckinExpiredAt int64 `json:"lastCheckinExpiredAt"`
}

BeenHere contains the number of times the acting user has been to the venue. Absent if there is no acting user.

type BoolAsAnInt

type BoolAsAnInt int

BoolAsAnInt is a bool that needs to be an int when transferred to an endpoint

type Category

type Category struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	PluralName string     `json:"pluralName"`
	ShortName  string     `json:"shortName"`
	Icon       Icon       `json:"icon"`
	Primary    bool       `json:"primary"`
	Categories []Category `json:"categories,omitempty"`
}

Category is a category applied to a venue https://developer.foursquare.com/docs/api/venues/categories

type Client

type Client struct {

	// Services used for talking to different parts of the API
	Venues *VenueService
	// contains filtered or unexported fields
}

Client is a Foursquare client for making Foursquare API requests.

func NewClient

func NewClient(httpClient *http.Client, mode, clientID, clientSecret, accessToken string) *Client

NewClient returns a new Client.

func (*Client) RawRequest

func (c *Client) RawRequest(url string) (*Response, *http.Response, error)

RawRequest allows you to make any request you want. This will automatically add the client/user tokens. Gives back exactly the response from foursquare.

type Color

type Color struct {
	PhotoID string `json:"photoId"`
	Value   int    `json:"value"`
}

Color is undocumented and part of colors struct

type Colors

type Colors struct {
	HighlightedColor     Color `json:"highlightColor"`
	HighlightedTextColor Color `json:"highlightTextColor"`
	AlgoVersion          int   `json:"algoVersion"`
}

Colors is undocumented

type Contact

type Contact struct {
	Phone            string `json:"phone"`
	FormattedPhone   string `json:"formattedPhone"`
	Twitter          string `json:"twitter"`
	Facebook         string `json:"facebook"`
	FacebookUsername string `json:"facebookUsername"`
	Instagram        string `json:"instagram"`
}

Contact are details to contact this venue. Can contain all or none.

type Count

type Count struct {
	Count int `json:"count"`
}

Count is a simple struct with just a count. Followers and todo are examples that only have a count.

type Entitie

type Entitie struct {
	Indices []int  `json:"indices"`
	Type    string `json:"type"`
}

Entitie contains where the Phrase is in the Sample.

type Entries

type Entries struct {
	Count int     `json:"count"`
	Items []Entry `json:"items"`
}

Entries is the Entires on a FullMenu.

type Entry

type Entry struct {
	SectionID string     `json:"sectionId"`
	Name      string     `json:"name"`
	Entries   SubEntries `json:"entries"`
}

Entry are the Items on a Entries.

type Event

type Event struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Categories []Category `json:"categories"`
	HereNow    HereNow    `json:"hereNow"`
	AllDay     bool       `json:"allDay"`
	StartAt    int64      `json:"startAt"`
	EndAt      int64      `json:"endAt"`
	Date       int64      `json:"date"`
	TimeZone   string     `json:"timeZone"`
	Stats      Stats      `json:"stats"`
	URL        string     `json:"url"`
}

Event is the Items in Events.

type Events

type Events struct {
	Count   int     `json:"count"`
	Summary string  `json:"summary"`
	Items   []Event `json:"items"`
}

Events is part of the respon for VenueService.Events

type ExploreSection

type ExploreSection string

ExploreSection are the section options on VenueService.Explore

const (
	SectionFood       ExploreSection = "food"
	SectionDrink      ExploreSection = "drink"
	SectionCoffee     ExploreSection = "coffee"
	SectionShops      ExploreSection = "shops"
	SectionArts       ExploreSection = "arts"
	SectionOutdoors   ExploreSection = "outdoors"
	SectionSights     ExploreSection = "sights"
	SectionTrending   ExploreSection = "trending"
	SectionSpecials   ExploreSection = "specials"
	SectionNextVenues ExploreSection = "nextVenues"
	SectionTopPicks   ExploreSection = "topPicks"
)

Options for ExploreSection

type ExploreTime

type ExploreTime string

ExploreTime are the time options on VenueService.Explore

const (
	TimeAny ExploreTime = "any"
)

Options for ExploreTime

type Filter

type Filter struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

Filter is a Filter in SuggestedFilters

type FriendVisit

type FriendVisit string

FriendVisit are the friendVisit options on VenueService.Explore

const (
	FriendVisited    FriendVisit = "visited"
	FriendNotVisited FriendVisit = "notvisited"
)

Options for FriendVisit

type FriendVisitItem

type FriendVisitItem struct {
	VisitedCount int  `json:"visitedCount"`
	Liked        bool `json:"liked"`
	Disliked     bool `json:"disliked"`
	Oked         bool `json:"oked"`
	User         User `json:"user"`
}

FriendVisitItem contains the user that visited along with information about their interaction with the venue.

type FriendVisits

type FriendVisits struct {
	Count   int               `json:"count"`
	Summary string            `json:"summary"`
	Items   []FriendVisitItem `json:"items"`
}

FriendVisits contains if an authed user's friends visited, includes self visits.

type FullMenu

type FullMenu struct {
	MenuID      string  `json:"menuId"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Entries     Entries `json:"entries"`
}

FullMenu are the items on a Menu.

type Group

type Group struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Group contains the default fields in a group. A lot of responses share these fields.

type HereNow

type HereNow struct {
	Count   int            `json:"count"`
	Summary string         `json:"summary"`
	Groups  []HereNowGroup `json:"Groups"`
}

HereNow contains which users are here now.

type HereNowGroup

type HereNowGroup struct {
	Group
	Items Omitted `json:"items"`
}

HereNowGroup is the groups item in HereNow.

type Hours

type Hours struct {
	Status         string      `json:"status"`
	IsOpen         bool        `json:"isOpen"`
	IsLocalHoliday bool        `json:"isLocalHoliday"`
	Timeframes     []TimeFrame `json:"timeframes"`
}

Hours contains hours during the week when a venue is open. Used in Venue struct.

type HoursOpen

type HoursOpen struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

HoursOpen contains the start time and end time when the HoursTimeFrame is open. Used only in HoursTimeFrame

type HoursResp

type HoursResp struct {
	TimeFrames []HoursTimeFrame `json:"timeframes"`
}

HoursResp is an struct inside the VenueHoursResp

type HoursTimeFrame

type HoursTimeFrame struct {
	Days          []int       `json:"days"`
	IncludesToday bool        `json:"includesToday"`
	Open          []HoursOpen `json:"open"`
}

HoursTimeFrame is specific to the hours endpoint it switches the Days from a string to an array. https://developer.foursquare.com/docs/api/venues/hours

type ID

type ID struct {
	ID string `json:"id"`
}

ID is a simple struct with just an id. VenuePage is an example.

type Icon

type Icon struct {
	Prefix string `json:"prefix"`
	Suffix string `json:"suffix"`
}

Icon is the pieces needed to construct icons at various sizes.

type Inbox

type Inbox struct {
	Count int     `json:"count"`
	Items Omitted `json:"items"`
}

Inbox is on a Venue.

type LabeledLatLngs

type LabeledLatLngs struct {
	Label string  `json:"label"`
	Lat   float64 `json:"lat"`
	Lng   float64 `json:"lng"`
}

LabeledLatLngs is further details in the Location of a venue.

type LatLong

type LatLong struct {
	Lat float64 `json:"lat"`
	Lng float64 `json:"lng"`
}

LatLong simple lat/long fields for SuggestedBounds

type LikeGroup

type LikeGroup struct {
	Group
	Items []User `json:"items"`
}

LikeGroup is a group of users for the Likes struct.

type Likes

type Likes struct {
	Count   int         `json:"count"`
	Groups  []LikeGroup `json:"groups"`
	Summary string      `json:"summary"`
}

Likes is a count of users who liked the venue and groups containing users who liked it (friends and others).

type LikesResp

type LikesResp struct {
	Count   int    `json:"count"`
	Summary string `json:"summary"`
	Items   []User `json:"items"`
	Like    bool   `json:"like"`
}

LikesResp is the response for the venue likes endpoint

type Link struct {
	Provider Provider `json:"provider"`
	LinkedID string   `json:"linkedId"`
	URL      string   `json:"url"`
}

Link is part of the response for the venues link endpoint https://developer.foursquare.com/docs/api/venues/links

type Links struct {
	Count int    `json:"count"`
	Items []Link `json:"items"`
}

Links is the response for VenueService.Links

type List

type List struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	Type          string    `json:"type"`
	User          User      `json:"user"`
	Editable      bool      `json:"editable"`
	Public        bool      `json:"public"`
	Collaborative bool      `json:"collaborative"`
	URL           string    `json:"url"`
	CanonicalURL  string    `json:"canonicalUrl"`
	CreatedAt     int       `json:"createdAt"`
	UpdatedAt     int       `json:"updatedAt"`
	Photo         Photo     `json:"photo"`
	LogView       bool      `json:"logView"`
	GuideType     string    `json:"guideType"`
	Guide         bool      `json:"guide"`
	Followers     Count     `json:"followers"`
	ListItems     ListItems `json:"listItems"`
}

List is a foursquare list. https://developer.foursquare.com/docs/api/lists/details

type ListGroup

type ListGroup struct {
	Group
	Items []List `json:"items"`
}

ListGroup is the standard group field where the items are of type List.

type ListItem

type ListItem struct {
	ID        string `json:"id"`
	CreatedAt int    `json:"createdAt"`
	Tip       Tip    `json:"tip"`
	Photo     Photo  `json:"photo"`
}

ListItem contains more information about a list. https://developer.foursquare.com/docs/api/lists/details

type ListItems

type ListItems struct {
	Count int        `json:"count"`
	Items []ListItem `json:"items"`
}

ListItems contains a count and an array of ListItem.

type Listed

type Listed struct {
	Count  int         `json:"count"`
	Groups []ListGroup `json:"groups"`
}

Listed contains a count and the grouped lists

type ListedGroup

type ListedGroup string

ListedGroup are the group options on VenueService.Listed

const (
	GroupListedOther ListedGroup = "other"
)

Options for a ListedGroup

type Lists

type Lists struct {
	Groups []Group `json:"groups"`
}

Lists are Lists on User.

type Location

type Location struct {
	Address          string           `json:"address"`
	CrossStreet      string           `json:"crossStreet"`
	Lat              float64          `json:"lat"`
	Lng              float64          `json:"lng"`
	LabeledLatLngs   []LabeledLatLngs `json:"labeledLatLngs"`
	PostalCode       string           `json:"postalCode"`
	Cc               string           `json:"cc"`
	Neighborhood     string           `json:"neighborhood"`
	City             string           `json:"city"`
	State            string           `json:"state"`
	Country          string           `json:"country"`
	FormattedAddress []string         `json:"formattedAddress"`
	IsFuzzed         bool             `json:"isFuzzed,omitempty"`
	Distance         int              `json:"distance,omitempty"`
}

Location is a location for the venue. Can contain all or none and some venues have a hidden location.

type Menu struct {
	Type      string `json:"type"`
	Label     string `json:"label"`
	Anchor    string `json:"anchor"`
	URL       string `json:"url"`
	MobileURL string `json:"mobileUrl"`
}

Menu contains how to access the menu for the venue.

type MenuProvider struct {
	Name             string `json:"name"`
	AttributionImage string `json:"attributionImage"`
	AttributionLink  string `json:"attributionLink"`
	AttributionText  string `json:"attributionText"`
}

MenuProvider is the Provider for the MenuResp.

type MenuResp struct {
	Provider MenuProvider `json:"provider"`
	Menus    Menus        `json:"menus"`
}

MenuResp is the response for VenueService.Menu.

type Menus struct {
	Count int        `json:"count"`
	Items []FullMenu `json:"items"`
}

Menus is part of the MenueResp.

type Meta

type Meta struct {
	Code        int    `json:"code"`
	ErrorType   string `json:"errorType"`
	ErrorDetail string `json:"errorDetail"`
	RequestID   string `json:"requestId"`
}

Meta contains request information and error details https://developer.foursquare.com/docs/api/troubleshooting/errors

type MiniVenue

type MiniVenue struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	Location Location   `json:"location"`
	Category []Category `json:"categories"`
	HasPerk  bool       `json:"hasPerk"`
}

MiniVenue is a compact Venue https://developer.foursquare.com/docs/api/venues/suggestcompletion

type Notification

type Notification struct {
	Type string  `json:"type"`
	Item Omitted `json:"item"`
}

Notification comes with all responses. https://developer.foursquare.com/docs/responses/notifications

type Novelty

type Novelty string

Novelty are the novelty options on VenueService.Explore

const (
	NoveltyNew Novelty = "new"
	NoveltyOld Novelty = "old"
)

Options for Novelty

type Omitted

type Omitted interface{}

Omitted is for fields that do not have a known datastructure. If you find an example where this field is used please let me know. You will need to handle this in your application until that time.

type Open

type Open struct {
	RenderedTime string `json:"renderedTime"`
}

Open contains how a timeframe would be written out. Used only in TimeFrame.

type Page

type Page struct {
	User User `json:"user"`
}

Page (optional) contains the user that is the branded page associated with the venue.

type PageUpdates

type PageUpdates struct {
	Count int     `json:"count"`
	Items Omitted `json:"items"`
}

PageUpdates is on a Venue.

type Photo

type Photo struct {
	ID         string      `json:"id"`
	CreatedAt  int         `json:"createdAt"`
	Source     PhotoSource `json:"source"`
	Prefix     string      `json:"prefix"`
	Suffix     string      `json:"suffix"`
	Demoted    bool        `json:"demoted"`
	Width      int         `json:"width"`
	Height     int         `json:"height"`
	User       User        `json:"user"`
	Visibility string      `json:"visibility"`
}

Photo is a foursquare photo https://developer.foursquare.com/docs/api/photos/details

type PhotoGroup

type PhotoGroup string

PhotoGroup are the group options on VenueService.Photos

const (
	GroupPhotoVenue   PhotoGroup = "venue"
	GroupPhotoCheckin PhotoGroup = "checkin"
)

Options for a PhotoGroup

type PhotoGrouping

type PhotoGrouping struct {
	Group
	Items []Photo `json:"items"`
}

PhotoGrouping is a default group with items of type photo.

type PhotoSource

type PhotoSource struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

PhotoSource is the source on a photo struct.

type Photos

type Photos struct {
	Count  int             `json:"count"`
	Groups []PhotoGrouping `json:"groups"`
}

Photos contains a count and groups of photos for the venue.

type Phrase

type Phrase struct {
	Phrase string `json:"phrase"`
	Sample Sample `json:"sample"`
	Count  int    `json:"count"`
}

Phrase contains a phrase commonly seen with a venue's tips.

type Price

type Price struct {
	Tier     int    `json:"tier"`
	Message  string `json:"message"`
	Currency string `json:"currency"`
}

Price is the price tier of a venue from 1 (least pricey) - 4 (most pricey).

type Provider

type Provider struct {
	ID string `json:"id"`
}

Provider is Provider in a Link.

type RateLimit

type RateLimit struct {
	Limit     int
	Path      string
	Remaining int
}

RateLimit is a struct of foursquare ratelimit data

func ParseRate

func ParseRate(resp *http.Response) *RateLimit

ParseRate is a helper function to get all the Rate info

type Reason

type Reason struct {
	Summary    string       `json:"summary"`
	Type       string       `json:"type"`
	ReasonName string       `json:"reasonName"`
	Message    string       `json:"message"`
	Target     ReasonTarget `json:"target"`
	Count      int          `json:"count"`
}

Reason is the items in Reasons.

type ReasonObject

type ReasonObject struct {
	ID         string             `json:"id"`
	Type       string             `json:"type"`
	Target     ReasonObjectTarget `json:"target"`
	Ignoreable bool               `json:"ignoreable"`
}

ReasonObject is Object in ReasonTarget.

type ReasonObjectTarget

type ReasonObjectTarget struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

ReasonObjectTarget what type of target and the url for a ReasonObject.

type ReasonTarget

type ReasonTarget struct {
	Type   string       `json:"type"`
	Object ReasonObject `json:"object"`
}

ReasonTarget where the reason would be shwon for Reason.

type Reasons

type Reasons struct {
	Count int      `json:"count"`
	Items []Reason `json:"items"`
}

Reasons why the venue is shown.

type Recommend

type Recommend struct {
	Reasons    Reasons `json:"reasons"`
	Venue      Venue   `json:"venue"`
	Tips       []Tip   `json:"tips"`
	ReferralID string  `json:"referralId"`
}

Recommend is a recommendation with a Venue for VenueService.Explore

type Recommendation

type Recommendation struct {
	Type  string      `json:"type"`
	Name  string      `json:"name"`
	Items []Recommend `json:"items"`
}

Recommendation the groups field in VenueExploreResp

type Response

type Response struct {
	Meta          Meta            `json:"meta"`
	Notifications []Notification  `json:"notifications"`
	Response      json.RawMessage `json:"response"`
}

Response is a typical foursquare response https://developer.foursquare.com/docs/api/getting-started#6-make-your-first-api-call

type Sample

type Sample struct {
	Entities []Entitie `json:"entities"`
	Text     string    `json:"text"`
}

Sample contains an example of a Phrase being used in a tip.

type SearchIntent

type SearchIntent string

SearchIntent are the intent options on VenueService.Search

const (
	IntentCheckin SearchIntent = "checkin"
	IntentBrowse  SearchIntent = "browse"
	IntentGlobal  SearchIntent = "global"
	IntentMatch   SearchIntent = "match"
)

Options for SearchIntent

type Stats

type Stats struct {
	CheckinsCount int `json:"checkinsCount"`
	UsersCount    int `json:"usersCount"`
	TipCount      int `json:"tipCount"`
	VisitsCount   int `json:"visitsCount"`
}

Stats are the stats for a venue.

type SubEntries

type SubEntries struct {
	Count int        `json:"count"`
	Items []SubEntry `json:"items"`
}

SubEntries are the Entries on an Entry

type SubEntry

type SubEntry struct {
	EntryID     string   `json:"entryId"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Prices      []string `json:"prices"`
	Price       string   `json:"price"`
	Options     Omitted  `json:"options"`
	Additions   Omitted  `json:"additions"`
}

SubEntry are the Items on a SubEntry

type SuggestedBounds

type SuggestedBounds struct {
	Ne LatLong `json:"ne"`
	Sw LatLong `json:"sw"`
}

SuggestedBounds are the bounds that were used in the search

type SuggestedFilters

type SuggestedFilters struct {
	Header  string   `json:"header"`
	Filters []Filter `json:"filters"`
}

SuggestedFilters are filters to show the user

type TimeFrame

type TimeFrame struct {
	Days          string  `json:"days"`
	IncludesToday bool    `json:"includesToday"`
	Open          []Open  `json:"open"`
	Segments      Omitted `json:"Segments"`
}

TimeFrame shows when a venue is open.

type Tip

type Tip struct {
	ID                    string  `json:"id"`
	CreatedAt             int     `json:"createdAt"`
	Text                  string  `json:"text"`
	Type                  string  `json:"type"`
	URL                   string  `json:"url"`
	CanonicalURL          string  `json:"canonicalurl"`
	Photo                 Photo   `json:"photo"`
	PhotoURL              string  `json:"photoUrl"`
	Flags                 Omitted `json:"flags"`
	Likes                 Likes   `json:"likes"`
	Like                  bool    `json:"like"`
	LogView               bool    `json:"logView"`
	Listed                Lists   `json:"listed"`
	AgreeCount            int     `json:"agreeCount"`
	DisagreeCount         int     `json:"disagreeCount"`
	Todo                  Count   `json:"todo"`
	User                  User    `json:"user"`
	AuthorInteractionType string  `json:"authorInteractionType"`
}

Tip is a foursquare tip on a venue.

type TipGroup

type TipGroup struct {
	Group
	Items []Tip `json:"items"`
}

TipGroup is the standard group field where the items are tips.

type TipSort

type TipSort string

TipSort is the sort options on VenueService.Tips

const (
	SortTipFriends TipSort = "friends"
	SortTipRecent  TipSort = "recent"
	SortTipPopular TipSort = "popular"
)

Options for TipSort

type Tips

type Tips struct {
	Count  int        `json:"count"`
	Groups []TipGroup `json:"groups"`
}

Tips contains a count and groups of tips.

type User

type User struct {
	ID           string  `json:"id"`
	FirstName    string  `json:"firstName"`
	LastName     string  `json:"lastName"`
	Gender       string  `json:"gender"`
	Relationship string  `json:"relationship"`
	Photo        *Photo  `json:"photo"`
	Type         string  `json:"type"`
	Venue        ID      `json:"venue"`
	Tips         Count   `json:"tips"`
	Lists        Lists   `json:"lists"`
	HomeCity     string  `json:"homeCity"`
	Bio          string  `json:"bio"`
	Contact      Contact `json:"contact"`
}

User is a foursquare user https://developer.foursquare.com/docs/api/users/details

type Venue

type Venue struct {
	ID               string       `json:"id"`
	Name             string       `json:"name"`
	Contact          Contact      `json:"contact"`
	Location         Location     `json:"location"`
	CanonicalURL     string       `json:"canonicalUrl"`
	Categories       []Category   `json:"categories"`
	Verified         bool         `json:"verified"`
	Stats            Stats        `json:"stats"`
	URL              string       `json:"url"`
	Price            Price        `json:"price"`
	HasMenu          bool         `json:"hasMenu"`
	Likes            Likes        `json:"likes"`
	Like             bool         `json:"like"`
	Dislike          bool         `json:"dislike"`
	Ok               bool         `json:"ok"`
	Rating           float64      `json:"rating"`
	RatingColor      string       `json:"ratingColor"`
	RatingSignals    int          `json:"ratingSignals"`
	Menu             Menu         `json:"menu"`
	AllowMenuURLEdit bool         `json:"allowMenuUrlEdit"`
	FriendVisits     FriendVisits `json:"friendVisits"`
	BeenHere         BeenHere     `json:"beenHere"`
	Specials         Omitted      `json:"Specials"`
	Photos           Photos       `json:"photos"`
	VenuePage        ID           `json:"venuePage"`
	Reasons          Reasons      `json:"reasons"`
	Description      string       `json:"description"`
	StoreID          string       `json:"storeId"`
	Page             Page         `json:"page"`
	HereNow          HereNow      `json:"hereNow"`
	CreatedAt        int64        `json:"createdAt"`
	Tips             Tips         `json:"tips"`
	ShortURL         string       `json:"shortUrl"`
	TimeZone         string       `json:"timeZone"`
	Listed           Listed       `json:"listed"`
	Phrases          []Phrase     `json:"phrases"`
	Hours            Hours        `json:"hours"`
	Popular          Hours        `json:"popular"`
	PageUpates       PageUpdates  `json:"pageUpdates"`
	Inbox            Inbox        `json:"inbox"`
	ReferralID       string       `json:"referralId"`
	VenueChains      Omitted      `json:"venueChains"`
	HasPerk          bool         `json:"hasPerk"`
	Attributes       Attributes   `json:"attributes"`
	BestPhoto        Photo        `json:"bestPhoto"`
	Colors           Colors       `json:"colors"`
}

Venue represents a foursquare Venue. https://developer.foursquare.com/docs/api/venues/details

type VenueExploreParams

type VenueExploreParams struct {
	LatLong          string         `url:"ll,omitempty"`
	Near             string         `url:"near,omitempty"`
	LatLongAccuracy  int            `url:"llAcc,omitempty"`
	Altitude         int            `url:"alt,omitempty"`
	AltitudeAccuracy int            `url:"altAcc,omitempty"`
	Radius           int            `url:"radius,omitempty"`
	Section          ExploreSection `url:"section,omitempty"`
	Query            string         `url:"query,omitempty"`
	Limit            int            `url:"limit,omitempty"`
	Offset           int            `url:"offset,omitempty"`
	Novelty          Novelty        `url:"novelty,omitempty"`
	FriendVisits     FriendVisit    `url:"friendVists,omitempty"`
	Time             ExploreTime    `url:"time,omitempty"`
	Day              ExploreTime    `url:"day,omitempty"`
	VenuePhotos      BoolAsAnInt    `url:"venuePhotos,omitempty"`
	LastVenue        string         `url:"lastVenue,omitempty"`
	OpenNow          BoolAsAnInt    `url:"openNow,omitempty"`
	SortByDistance   BoolAsAnInt    `url:"sortByDistance,omitempty"`
	Price            []int          `url:"price,omitempty"`
	Saved            BoolAsAnInt    `url:"saved,omitempty"`
	Specials         BoolAsAnInt    `url:"specials,omitempty"`
}

VenueExploreParams are the parameters for VenueService.Explore

type VenueExploreResp

type VenueExploreResp struct {
	SuggestedFilters          SuggestedFilters `json:"suggestedFilters"`
	Warning                   Warning          `json:"warning"`
	SuggestedRadius           int              `json:"suggestedRadius"`
	HeaderLocation            string           `json:"headerLocation"`
	HeaderFullLocation        string           `json:"headerFullLocation"`
	HeaderLocationGranularity string           `json:"headerLocationGranularity"`
	TotalResults              int              `json:"totalResults"`
	SuggestedBounds           SuggestedBounds  `json:"suggestedBounds"`
	Groups                    []Recommendation `json:"groups"`
}

VenueExploreResp is the response for VenueService.Explore https://developer.foursquare.com/docs/api/venues/explore

type VenueHoursResp

type VenueHoursResp struct {
	Hours   HoursResp `json:"hours"`
	Popular HoursResp `json:"popular"`
}

VenueHoursResp is the response for the venue hours endpoint

type VenueListedParams

type VenueListedParams struct {
	VenueID string      `url:"-"`
	Group   ListedGroup `url:"group,omitempty"`
	Limit   int         `url:"limit,omitempty"`
	Offset  int         `url:"offset,omitempty"`
}

VenueListedParams are the parameters for VenueService.Listed

type VenuePhotosParams

type VenuePhotosParams struct {
	VenueID string     `url:"-"`
	Group   PhotoGroup `url:"group,omitempty"`
	Limit   int        `url:"limit,omitempty"`
	Offset  int        `url:"offset,omitempty"`
}

VenuePhotosParams are the paremeters for the VenueService.Photos

type VenueSearchParams

type VenueSearchParams struct {
	LatLong          string       `url:"ll,omitempty"`
	Near             string       `url:"near,omitempty"`
	LatLongAccuracy  int          `url:"llAcc,omitempty"`
	Altitude         int          `url:"alt,omitempty"`
	AltitudeAccuracy int          `url:"altAcc,omitempty"`
	Query            string       `url:"query,omitempty"`
	Limit            int          `url:"limit,omitempty"`
	Intent           SearchIntent `url:"intent,omitempty"`
	Radius           int          `url:"radius,omitempty"`
	Sw               string       `url:"sw,omitempty"`
	Ne               string       `url:"ne,omitempty"`
	CategoryID       []string     `url:"categoryId,omitempty"`
	URL              string       `url:"url,omitempty"`
	ProviderID       string       `url:"providerId,omitempty"`
	LinkedID         int          `url:"linkedId,omitempty"`
}

VenueSearchParams are the parameters for the VenueService.Search

type VenueService

type VenueService struct {
	// contains filtered or unexported fields
}

VenueService provies a method for accessing Foursquare venue endpoints

func (*VenueService) Categories

func (s *VenueService) Categories() ([]Category, *http.Response, error)

Categories returns a hierarchical list of categories applied to venues. https://developer.foursquare.com/docs/api/venues/categories

func (*VenueService) Details

func (s *VenueService) Details(id string) (*Venue, *http.Response, error)

Details gets all the data for a venue https://developer.foursquare.com/docs/api/venues/details

func (*VenueService) Events

func (s *VenueService) Events(id string) (*Events, *http.Response, error)

Events are music and movie events at this venue https://developer.foursquare.com/docs/api/venues/events

func (*VenueService) Explore

Explore returns a list of recommended venues near the current location. https://developer.foursquare.com/docs/api/venues/explore

func (*VenueService) Hours

func (s *VenueService) Hours(id string) (*VenueHoursResp, *http.Response, error)

Hours Returns hours for a venue. https://developer.foursquare.com/docs/api/venues/hours

func (*VenueService) Likes

func (s *VenueService) Likes(id string) (*LikesResp, *http.Response, error)

Likes returns friends and a total count of users who have liked this venue. https://developer.foursquare.com/docs/api/venues/likes

func (s *VenueService) Links(id string) (*Links, *http.Response, error)

Links returns URLs or identifies from third parties for this venue https://developer.foursquare.com/docs/api/venues/links

func (*VenueService) Listed

func (s *VenueService) Listed(params *VenueListedParams) (*Listed, *http.Response, error)

Listed returns the lists that this venue appears on https://developer.foursquare.com/docs/api/venues/listed

func (*VenueService) Menu

func (s *VenueService) Menu(id string) (*MenuResp, *http.Response, error)

Menu returns menu information for a venue. https://developer.foursquare.com/docs/api/venues/menu

func (*VenueService) NextVenues

func (s *VenueService) NextVenues(id string) ([]Venue, *http.Response, error)

NextVenues returns venues that are checked into after the given one https://developer.foursquare.com/docs/api/venues/nextvenues

func (*VenueService) Photos

Photos gets photos for a venue https://developer.foursquare.com/docs/api/venues/photos

func (*VenueService) Search

func (s *VenueService) Search(params *VenueSearchParams) ([]Venue, *http.Response, error)

Search returns a list of venues near the current location, optionally matching a search term. https://developer.foursquare.com/docs/api/venues/search

func (*VenueService) SetHeader

func (s *VenueService) SetHeader(key, value string) *VenueService

SetHeader sets a header to be sent with the request for internationalization https://developer.foursquare.com/docs/api/configuration/versioning

func (*VenueService) SuggestCompletion

func (s *VenueService) SuggestCompletion(params *VenueSuggestParams) ([]MiniVenue, *http.Response, error)

SuggestCompletion returns a list of mini-venues partially matching the search term, near the location. https://developer.foursquare.com/docs/api/venues/suggestcompletion

func (*VenueService) Tips

func (s *VenueService) Tips(params *VenueTipsParams) ([]Tip, *http.Response, error)

Tips returns tips for a venue. https://developer.foursquare.com/docs/api/venues/tips

func (*VenueService) Trending

func (s *VenueService) Trending(params *VenueTrendingParams) ([]Venue, *http.Response, error)

Trending returns a list of venues near the current location with the most people currently checked in. https://developer.foursquare.com/docs/api/venues/trending

type VenueSuggestParams

type VenueSuggestParams struct {
	LatLong          string `url:"ll,omitempty"`
	Near             string `url:"near,omitempty"`
	LatLongAccuracy  int    `url:"llAcc,omitempty"`
	Altitude         int    `url:"alt,omitempty"`
	AltitudeAccuracy int    `url:"altAcc,omitempty"`
	Query            string `url:"query,omitempty"`
	Limit            int    `url:"limit,omitempty"`
	Radius           int    `url:"radius,omitempty"`
	Sw               string `url:"sw,omitempty"`
	Ne               string `url:"ne,omitempty"`
}

VenueSuggestParams are the parementers for the VenueService.SuggestCompletion

type VenueTipsParams

type VenueTipsParams struct {
	VenueID string  `url:"-"`
	Sort    TipSort `url:"sort,omitempty"`
	Limit   int     `url:"limit,omitempty"`
	Offset  int     `url:"offset,omitempty"`
}

VenueTipsParams are the parameters for VenueService.Tips

type VenueTrendingParams

type VenueTrendingParams struct {
	LatLong string `url:"ll,omitempty"`
	Limit   int    `url:"limit,omitempty"`
	Radius  int    `url:"radius,omitempty"`
}

VenueTrendingParams are the parameters for VenueService.Trending

type Warning

type Warning struct {
	Text string `json:"text"`
}

Warning is a text field that contains a warning message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL