Skip to content

Commit

Permalink
Add documentation for getTrackInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
masterT committed Sep 10, 2022
1 parent 3c5df02 commit 030f711
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,31 @@ bandcamp.getArtistInfo(artistUrl, function (error, artistInfo) {

[View example with output](examples/getArtistInfo.js).

### `getTrackInfo(trackUrl, callback)`

Retrieves the track info from its URL.

- trackUrl _String_
- callback _Function(error, trackInfo)_

#### Track Info

An _Object_ that represents the track's info. It matches the [track-info JSON schema](/schemas/track-info.json).
#### Example

```js
const bandcamp = require('bandcamp-scraper')

const trackUrl = 'https://dafnez.bandcamp.com/track/serenade'
bandcamp.getTrackInfo(trackUrl, function (error, trackInfo) {
if (error) {
console.log(error)
} else {
console.log(trackInfo)
}
})
```

## Test

Feature tests are run _daily_, thanks to [GitHub Action](https://docs.github.com/en/free-pro-team@latest/actions) schedule actions. This way we know if the scraper is ever broken.
Expand Down

0 comments on commit 030f711

Please sign in to comment.