TooGoodToGoGo is an unofficial API wrapper for the mobile application too good to go
go get github.com/simonmartyr/toogoodtogogo
import "github.com/simonmartyr/toogoodtogogo"
creating a new client:
client := toogoodtogo.New(
&http.Client{},
toogoodtogo.WithUsername("youremail@youremail.co.uk"),
)
It is also possible to create a client with an already know access tokens:
client := toogoodtogo.New(
&http.Client{},
toogoodtogo.WithUsername("youremail@youremail.co.uk"),
toogoodtogo.WithAuth("myId", "myAccessToken", "MyRefreshToken", "Mycookie"),
)
This table highlights known endpoints and which are currently usable with the wrapper.
Endpoint Name | Description | Supported |
---|---|---|
Authenticate | Login via magic/email link | ✓ |
Refresh Auth | Request new Access, Refresh tokens | ✓ |
Get Favorite Items | Query for items marked as favorite | ✓ |
Search For Items | Find items based on different search criteria | ✓ |
Get Single Item | Get details about one item by id | ✓ |
Set Item as Favorite | Mark an item as a favorite | ✓ |
Create Order | Begin process of buying item | ✗ |
Get Order Status | Check current status of an order | ✗ |
Cancel Order | Cancel an order which isn't complete | ✗ |
Signup | Signup to too good to go | ✗ |
Get Active Orders | Find currently active orders | ✗ |
Get Inactive Orders | Find past orders | ✗ |