1
1
# geniURL
2
2
3
3
Simple JSON and XML REST API to search for song metadata and the lyrics URL on [ genius.com] ( https://genius.com/ )
4
- Obtaining actual lyrics sadly isn't possible due to licensing and copyright reasons
4
+ Authorization is not required and geniURL implements a fuzzy search that will greatly improve search results over the genius.com API.
5
+
6
+ Obtaining actual lyrics sadly isn't possible due to licensing and copyright reasons.
5
7
6
8
<br ><br >
7
9
@@ -32,26 +34,35 @@ All routes support gzip and deflate compression.
32
34
33
35
> ### GET ` /search `
34
36
>
35
- > This endpoint gives you the top 10 results for a search query specified by ` search_text `
36
- > The returned data contains various data like the lyrics website URL, song and thumbnail metadata and more (see below).
37
+ > This endpoint gives you up to 10 results for a search query specified by ` search_text `
38
+ > The returned payload contains various data like the lyrics website URL, song and thumbnail metadata and more (see below).
37
39
>
38
40
> <br >
39
41
>
40
42
> ** URL Parameters:**
41
43
> ` ?q=search%20query `
42
44
> This parameter should contain both the song and artist name (for best result artist name should come first, separate with a whitespace).
43
45
> Sometimes the song name alone might be enough but the results vary greatly.
44
- > Using this parameter instead of ` ?artist ` and ` ?song ` will not modify the search results and so you will sometimes get blatantly wrong top matches .
46
+ > Using this parameter instead of ` ?artist ` and ` ?song ` means you will get slightly less accurate results .
45
47
> Make sure the search query is [ percent/URL-encoded.] ( https://en.wikipedia.org/wiki/Percent-encoding )
46
- >
48
+ >
49
+ > ** OR**
50
+ >
47
51
> ` ?artist=name ` and ` ?song=name `
48
- > Instead of ` ?q ` , you can use ` ?artist ` and ` ?song ` to tell geniURL to preemptively filter the search results.
49
- > This is done using a fuzzy search to greatly increase the chances the correct search result will be at the top.
52
+ > Instead of ` ?q ` , you can use ` ?artist ` and ` ?song ` to help geniURL filter the search results better, so your top results will be more accurate.
50
53
> Make sure these parameters are [ percent/URL-encoded.] ( https://en.wikipedia.org/wiki/Percent-encoding )
51
- >
54
+ >
55
+ > <br >
56
+ >
57
+ > ** Optional URL Parameters:**
52
58
> ` ?format=json/xml `
53
- > Use this parameter to change the response format from the default (` json ` ) to ` xml `
59
+ > Use this optional parameter to change the response format from the default (` json ` ) to ` xml `
54
60
> The structure of the XML data is similar to the shown JSON data.
61
+ >
62
+ > ` ?threshold=0.65 `
63
+ > This optional parameter can be used to change the fuzzy search threshold from the default of 0.65
64
+ > It has to be between 0.0 and 1.0; the lower the number, the less results you'll get but the more accurate the top results will be.
65
+ > 0.65 is a good middle ground but depending on your use-case you might want to play around with this.
55
66
>
56
67
> <br >
57
68
>
@@ -64,23 +75,23 @@ All routes support gzip and deflate compression.
64
75
> " error" : false ,
65
76
> " matches" : 10 ,
66
77
> " top" : {
67
- > " url" : " https://genius.com/Artist-1 -song-name-lyrics" ,
68
- > " path" : " /Artist-1 -song-name-lyrics" ,
78
+ > " url" : " https://genius.com/Artist-Foo -song-name-lyrics" ,
79
+ > " path" : " /Artist-Foo -song-name-lyrics" ,
69
80
> " language" : " en" ,
70
81
> " meta" : {
71
82
> " title" : " Song Name" ,
72
- > " fullTitle" : " Song Name by Artist 1 (ft. Artist 2 )" ,
73
- > " artists" : " Artist 1 (ft. Artist 2 )" ,
83
+ > " fullTitle" : " Song Name by Artist Foo (ft. Artist Bar )" ,
84
+ > " artists" : " Artist Foo (ft. Artist Bar )" ,
74
85
> " primaryArtist" : {
75
- > " name" : " Artist 1 " ,
76
- > " url" : " https://genius.com/artists/Artist-1 " ,
86
+ > " name" : " Artist Foo " ,
87
+ > " url" : " https://genius.com/artists/Artist-Foo " ,
77
88
> " headerImage" : " https://images.genius.com/..." ,
78
89
> " image" : " https://images.genius.com/..."
79
90
> },
80
91
> " featuredArtists" : [
81
92
> {
82
- > " name" : " Featured Artist 1 " ,
83
- > " url" : " https://genius.com/artists/Featured- Artist-1 " ,
93
+ > " name" : " Artist Bar " ,
94
+ > " url" : " https://genius.com/artists/Artist-Bar " ,
84
95
> " headerImage" : " https://images.genius.com/..." ,
85
96
> " image" : " https://images.genius.com/..."
86
97
> }
@@ -139,7 +150,7 @@ All routes support gzip and deflate compression.
139
150
140
151
> ### GET ` / search/ top`
141
152
>
142
- > This endpoint is the same as ` / search` , but it only gives the top result.
153
+ > This endpoint is similar to ` / search` , but it only gives the top result.
143
154
> Use this if you are only interested in the top result and want to reduce traffic.
144
155
>
145
156
> <br>
@@ -148,17 +159,26 @@ All routes support gzip and deflate compression.
148
159
> ` ? q= search% 20query `
149
160
> This parameter should contain both the song and artist name (for best result artist name should come first, separate with a whitespace).
150
161
> Sometimes the song name alone might be enough but the results vary greatly.
151
- > Using this parameter instead of ` ? artist` and ` ? song` will not modify the search result and so you will sometimes get a blatantly wrong top match .
162
+ > Using this parameter instead of ` ? artist` and ` ? song` means you will get slightly less accurate results .
152
163
> Make sure the search query is [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)
153
- >
164
+ >
165
+ > **OR**
166
+ >
154
167
> ` ? artist= name` and ` ? song= name`
155
- > Instead of ` ? q` , you can use ` ? artist` and ` ? song` to tell geniURL to preemptively filter the search results.
156
- > This is done using a fuzzy search to greatly increase the chances the correct search result will be returned.
168
+ > Instead of ` ? q` , you can use ` ? artist` and ` ? song` to help geniURL filter the search results better, so your top results will be more accurate.
157
169
> Make sure these parameters are [percent/URL-encoded.](https://en.wikipedia.org/wiki/Percent-encoding)
158
- >
170
+ >
171
+ > <br><br>
172
+ >
173
+ > **Optional URL Parameters:**
159
174
> ` ? format= json/ xml`
160
- > Use this parameter to change the response format from the default (` json` ) to ` xml`
175
+ > Use this optional parameter to change the response format from the default (` json` ) to ` xml`
161
176
> The structure of the XML data is similar to the shown JSON data.
177
+ >
178
+ > ` ? threshold= 0.65 `
179
+ > This optional parameter can be used to change the fuzzy search threshold from the default of 0.65
180
+ > It has to be between 0.0 and 1.0; the lower the number, the less results you'll get but the more accurate the top results will be.
181
+ > 0.65 is a good middle ground but depending on your use-case you might want to play around with this.
162
182
>
163
183
> <br>
164
184
>
@@ -170,23 +190,23 @@ All routes support gzip and deflate compression.
170
190
> {
171
191
> " error" : false ,
172
192
> " matches" : 1 ,
173
- > " url" : " https://genius.com/Artist-1 -song-name-lyrics" ,
174
- > " path" : " /Artist-1 -song-name-lyrics" ,
193
+ > " url" : " https://genius.com/Artist-Foo -song-name-lyrics" ,
194
+ > " path" : " /Artist-Foo -song-name-lyrics" ,
175
195
> " language" : " en" ,
176
196
> " meta" : {
177
197
> " title" : " Song Name" ,
178
- > " fullTitle" : " Song Name by Artist 1 (ft. Artist 2 )" ,
179
- > " artists" : " Artist 1 (ft. Artist 2 )" ,
198
+ > " fullTitle" : " Song Name by Artist Foo (ft. Artist Bar )" ,
199
+ > " artists" : " Artist Foo (ft. Artist Bar )" ,
180
200
> " primaryArtist" : {
181
- > " name" : " Artist 1 " ,
182
- > " url" : " https://genius.com/artists/Artist-1 " ,
201
+ > " name" : " Artist Foo " ,
202
+ > " url" : " https://genius.com/artists/Artist-Foo " ,
183
203
> " headerImage" : " https://images.genius.com/..." ,
184
204
> " image" : " https://images.genius.com/..."
185
205
> },
186
206
> " featuredArtists" : [
187
207
> {
188
- > " name" : " Featured Artist 1 " ,
189
- > " url" : " https://genius.com/artists/Featured- Artist-1 " ,
208
+ > " name" : " Artist Bar " ,
209
+ > " url" : " https://genius.com/artists/Artist-Bar " ,
190
210
> " headerImage" : " https://images.genius.com/..." ,
191
211
> " image" : " https://images.genius.com/..."
192
212
> }
0 commit comments