Files
tinder-api-wrapper/README.md

94 lines
2.3 KiB
Markdown

# Tinder API Wrapper
A Go wrapper for the Tinder API that provides easy access to basic Tinder functionality such as liking/passing users and getting recommendations.
## Features
- Simple, idiomatic Go API
- Support for Tinder's core endpoints:
- Like a user
- Pass on a user
- Get user recommendations
- Configurable API endpoint
## Installation
```bash
go get tinder-api-wrapper
```
## Usage
```go
package main
import (
"fmt"
"log"
tinder "tinder-api-wrapper"
)
func main() {
// Create a new client with the desired API endpoint
client, err := tinder.NewClient("https://tinder.cloonar.com")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Get recommendations
recs, err := client.GetRecommendations("en")
if err != nil {
log.Fatalf("Failed to get recommendations: %v", err)
}
// Like a user
likeResp, err := client.LikeUser("user123")
if err != nil {
log.Fatalf("Failed to like user: %v", err)
}
fmt.Printf("Match: %v, Likes remaining: %d\n", likeResp.Match, likeResp.LikesRemaining)
// Pass on a user
passResp, err := client.PassUser("user456")
if err != nil {
log.Fatalf("Failed to pass on user: %v", err)
}
fmt.Printf("Status: %s\n", passResp.Status)
}
```
See the `example` directory for more detailed usage examples.
## API Methods
### NewClient(endpoint string) (*Client, error)
Creates a new Tinder API client with the specified API endpoint.
### (c *Client) LikeUser(userID string) (*LikeResponse, error)
Likes a user with the given ID.
### (c *Client) PassUser(userID string) (*PassResponse, error)
Passes on (dislikes) a user with the given ID.
### (c *Client) GetRecommendations(locale string) (*RecsResponse, error)
Retrieves a list of recommended user profiles. The `locale` parameter is optional and can be an empty string.
## Types
The wrapper includes the following main types for API responses:
- `LikeResponse`: Response from liking a user
- `PassResponse`: Response from passing on a user
- `RecsResponse`: Recommendations response containing user profiles
- `UserRecommendation`: Detailed user profile information
- `Photo`: User photo information
- `InstagramPhoto`: Instagram photo information
## License
This project is available under the MIT License.