crawlbaseDocs
Log in

API usage

Add &scraper=exercism-exercise 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/two-fer' \
  --data-urlencode 'scraper=exercism-exercise' -G
from crawlbase import CrawlingAPI

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

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/two-fer',
  { scraper: 'exercism-exercise' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

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

Example input URL

Any Exercism exercise overview page works in the url parameter - the page at /tracks/<track>/exercises/<slug>. For example:

https://exercism.org/tracks/ruby/exercises/two-fer
https://exercism.org/tracks/python/exercises/leap
https://exercism.org/tracks/go/exercises/hello-world
https://exercism.org/tracks/rust/exercises/grains

Response shape

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

url
string
URL of the exercise page that was scraped.
track
string | null
Track slug read from the URL path (for example ruby), or null when it cannot be determined.
slug
string | null
Exercise slug read from the URL path (for example two-fer), or null when it cannot be determined.
title
string | null
Exercise display title.
difficulty
string | null
Difficulty label (for example easy, medium, hard).
instructions
string | null
Full exercise instructions as plain text, with whitespace collapsed.
instructionsHtml
string | null
Full exercise instructions as HTML, preserving headings, code blocks, and lists.

Sample response

{
  "url": "https://exercism.org/tracks/ruby/exercises/two-fer",
  "track": "ruby",
  "slug": "two-fer",
  "title": "Two Fer",
  "difficulty": "easy",
  "instructions": "Two Fer Two-fer is short for two for one. One for you and one for me. Given a name, return a string with the message: One for name, one for me. Where \"name\" is the given name. However, if the name is missing, return the string: One for you, one for me.",
  "instructionsHtml": "

Instructions

\n

Two-fer is short for two for one. One for you and one for me.

\n

Given a name, return a string with the message:

\n
One for name, one for me.
" }