> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindcase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# SoundCloud Tracks API

> SoundCloud tracks with track URL, artist details and play count. Search by keyword or pass URLs.

`POST /v1/data/soundcloud/tracks/run`

**Pricing:** $0.001 per track ($1.00 per 1,000).

## Ways to call it

* **Search Keywords**: set `queries` (optional: `maxResults`, `postedAfter`, `postedBefore`)
* **URLs**: set `urls` (optional: `maxResults`, `postedAfter`, `postedBefore`)

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**queries** `string[]`

One or more search keywords. One request reads them all.

**urls** `string[]`

One or more urls. One request reads them all.

**maxResults** `integer` (default: 100)

How many tracks to return in total. Defaults to 100; use 0 for all.

Max `1000`.

**postedAfter** `date`

Posted After as a date (YYYY-MM-DD).

**postedBefore** `date`

Posted Before as a date (YYYY-MM-DD).

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/soundcloud/tracks/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "queries": [
      "lofi hip hop"
    ],
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/soundcloud/tracks/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "queries": [
        "lofi hip hop"
    ],
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/soundcloud/tracks/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "queries": [
    "lofi hip hop"
  ],
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one track, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `title` | Title | text |
| `trackUrl` | Track URL | url |
| `trackId` | Track ID | text |
| `artist` | Artist | text |
| `artistUrl` | Artist URL | url |
| `artistId` | Artist ID | text |
| `plays` | Plays | number |
| `likes` | Likes | number |
| `reposts` | Reposts | number |
| `comments` | Comments | number |
| `durationS` | Duration S | number |
| `genre` | Genre | text |
| `tags` | Tags | array |
| `postedDate` | Posted Date | datetime |
| `displayDate` | Display Date | datetime |
| `description` | Description | text |
| `artwork` | Artwork | image |
| `label` | Label | text |
| `isrc` | Isrc | text |
| `license` | License | text |
| `artistFollowers` | Artist Followers | number |
| `artistVerified` | Artist Verified | boolean |
| `sourceQuery` | Source Query | text |
| `rank` | Rank | number |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "soundcloud/tracks",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "artistVerified": false,
      "genre": "Hip-hop & Rap",
      "rank": 1,
      "trackId": "417474360",
      "artistId": "154582242",
      "postedDate": "2018-03-22T08:35:48Z",
      "label": null,
      "reposts": 2223,
      "artistFollowers": 4145,
      "description": "Enjoy 🔊\nFull tracklist\n\n[00:00:00] idealism - last time\n[00:02:50] Philanthrope X Kupla - Cycles\n[00:05:25] bloopr - mondayloop [no friends, no worries]\n[00:...",
      "plays": 4860780,
      "likes": 94646,
      "tags": [
        "Lo-Fi",
        "Relax"
      ],
      "comments": 4856,
      "trackUrl": "https://soundcloud.com/nigeldelviero/chill-study-beats-lofi-hip-hop-mix-2018",
      "displayDate": "2018-03-22T08:35:48Z",
      "artwork": "https://i1.sndcdn.com/artworks-000321524016-jw118f-t500x500.jpg",
      "artistUrl": "https://soundcloud.com/nigeldelviero",
      "isrc": null,
      "artist": "nigeldelviero",
      "license": "all-rights-reserved",
      "sourceQuery": "lofi hip hop",
      "title": "Chill Study Beats - Lofi Hip Hop Mix [2018]",
      "durationS": 7200.255
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.