crawlbaseDocs
Log in

API usage

Add &scraper=exercism-serp to a Crawling API request. URL-encode the target URL in the url parameter.

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://exercism.org/tracks/ruby/exercises' \
  --data-urlencode 'scraper=exercism-serp' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://exercism.org/tracks/ruby/exercises',
    {'scraper': 'exercism-serp'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://exercism.org/tracks/ruby/exercises',
  { scraper: 'exercism-serp' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://exercism.org/tracks/ruby/exercises', scraper: 'exercism-serp')
data = JSON.parse(res.body)

Example input URL

Any Exercism track exercise-list page works in the url parameter - the page at /tracks/<track>/exercises for any language track. For example:

https://exercism.org/tracks/ruby/exercises
https://exercism.org/tracks/python/exercises
https://exercism.org/tracks/go/exercises
https://exercism.org/tracks/javascript/exercises
https://exercism.org/tracks/rust/exercises

Response shape

JSON response body. Field types may be null when the source page omits the value.

trackUrl
string
URL of the track exercise-list page that was scraped.
track
string | null
Track slug read from the URL path (for example ruby), or null when it cannot be determined.
exerciseCount
integer
Number of exercises returned in exercises.
exercises
array
Exercises on the track, in listing order.
exercises[].slug
string
Exercise slug (URL fragment, for example two-fer).
exercises[].type
string
Exercise type (for example practice or tutorial).
exercises[].title
string
Exercise display title.
exercises[].iconUrl
string
URL of the exercise icon.
exercises[].difficulty
string
Difficulty label (for example easy, medium, hard).
exercises[].blurb
string
Short one-line description of the exercise.
exercises[].isExternal
boolean
True when the exercise is hosted outside the track.
exercises[].isUnlocked
boolean
True when the exercise is unlocked for the viewer.
exercises[].isRecommended
boolean
True when Exercism recommends the exercise next.
exercises[].url
string | null
Canonical URL of the exercise overview page, or null when absent.

Sample response

{
  "trackUrl": "https://exercism.org/tracks/ruby/exercises",
  "track": "ruby",
  "exerciseCount": 3,
  "exercises": [
    {
      "slug": "two-fer",
      "type": "practice",
      "title": "Two Fer",
      "iconUrl": "https://assets.exercism.org/exercises/two-fer.svg",
      "difficulty": "easy",
      "blurb": "Create a sentence of the form \"One for X, one for me.\"",
      "isExternal": false,
      "isUnlocked": true,
      "isRecommended": false,
      "url": "https://exercism.org/tracks/ruby/exercises/two-fer"
    },
    {
      "slug": "hello-world",
      "type": "practice",
      "title": "Hello World",
      "iconUrl": "https://assets.exercism.org/exercises/hello-world.svg",
      "difficulty": "easy",
      "blurb": "The classical introductory exercise. Just say \"Hello, World!\"",
      "isExternal": false,
      "isUnlocked": true,
      "isRecommended": true,
      "url": "https://exercism.org/tracks/ruby/exercises/hello-world"
    },
    {
      "slug": "grains",
      "type": "practice",
      "title": "Grains",
      "iconUrl": "https://assets.exercism.org/exercises/grains.svg",
      "difficulty": "medium",
      "blurb": "Calculate the number of grains of wheat on a chessboard.",
      "isExternal": false,
      "isUnlocked": true,
      "isRecommended": false,
      "url": "https://exercism.org/tracks/ruby/exercises/grains"
    }
  ]
}