Skip to content

Commit a2062b1

Browse files
committed
Enhance README with clearer examples for public data and OAuth usage
1 parent 7f00321 commit a2062b1

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ composer require calliostro/php-discogs-api
3535

3636
## 🚀 Quick Start
3737

38+
**Public data (no registration needed):**
39+
3840
```php
39-
// Public data (no registration needed)
4041
$discogs = DiscogsClientFactory::create();
41-
$artist = $discogs->getArtist(5590213); // Billie Eilish
42-
$release = $discogs->getRelease(19929817); // Olivia Rodrigo - Sour
43-
$label = $discogs->getLabel(2311); // Interscope Records
4442

45-
// Search (consumer credentials) - Modern parameter styles
43+
$artist = $discogs->getArtist(5590213); // Billie Eilish
44+
$release = $discogs->getRelease(19929817); // Olivia Rodrigo - Sour
45+
$label = $discogs->getLabel(2311); // Interscope Records
46+
```
47+
48+
**Search with consumer credentials:**
49+
50+
```php
4651
$discogs = DiscogsClientFactory::createWithConsumerCredentials('key', 'secret');
4752

4853
// Positional parameters (traditional)
@@ -57,9 +62,13 @@ $releases = $discogs->listArtistReleases(
5762
sortOrder: 'desc',
5863
perPage: 25
5964
);
65+
```
66+
67+
**Your collections (personal token):**
6068

61-
// Your collections (personal token)
69+
```php
6270
$discogs = DiscogsClientFactory::createWithPersonalAccessToken('token');
71+
6372
$collection = $discogs->listCollectionFolders('your-username');
6473
$wantlist = $discogs->getUserWantlist('your-username');
6574

@@ -69,9 +78,13 @@ $discogs->addToCollection(
6978
folderId: 1,
7079
releaseId: 30359313
7180
);
81+
```
7282

73-
// Multi-user apps (OAuth)
83+
**Multi-user apps (OAuth):**
84+
85+
```php
7486
$discogs = DiscogsClientFactory::createWithOAuth('key', 'secret', 'oauth_token', 'oauth_secret');
87+
7588
$identity = $discogs->getIdentity();
7689
```
7790

0 commit comments

Comments
 (0)