Code Examples
Copy-paste examples for every major language. Replace lsc_your_api_key with your actual key from the dashboard.
Fetch a URL
cURL
Codecurl -X POST https://api.link.sc/v1/fetch \ -H "Content-Type: application/json" \ -H "x-api-key: lsc_your_api_key" \ -d '{"url": "https://example.com", "format": "markdown"}'
Python
Codeimport requests response = requests.post( "https://api.link.sc/v1/fetch", headers={ "Content-Type": "application/json", "x-api-key": "lsc_your_api_key", }, json={ "url": "https://example.com", "format": "markdown", }, ) data = response.json() print(data["markdown"])
JavaScript / Node.js
Codeconst response = await fetch("https://api.link.sc/v1/fetch", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": "lsc_your_api_key", }, body: JSON.stringify({ url: "https://example.com", format: "markdown", }), }); const data = await response.json(); console.log(data.markdown);
Go
Codepackage main import ( "bytes" "encoding/json" "fmt" "net/http" "io" ) func main() { body, _ := json.Marshal(map[string]string{ "url": "https://example.com", "format": "markdown", }) req, _ := http.NewRequest("POST", "https://api.link.sc/v1/fetch", bytes.NewBuffer(body)) req.Header.Set("Content-Type", "application/json") req.Header.Set("x-api-key", "lsc_your_api_key") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() result, _ := io.ReadAll(resp.Body) fmt.Println(string(result)) }
Ruby
Coderequire "net/http" require "json" require "uri" uri = URI("https://api.link.sc/v1/fetch") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri) request["Content-Type"] = "application/json" request["x-api-key"] = "lsc_your_api_key" request.body = { url: "https://example.com", format: "markdown" }.to_json response = http.request(request) data = JSON.parse(response.body) puts data["markdown"]
Web Search
cURL
Codecurl -X POST https://api.link.sc/v1/search \ -H "Content-Type: application/json" \ -H "x-api-key: lsc_your_api_key" \ -d '{"q": "latest NVIDIA earnings", "engine": "google"}'
Python
Codeimport requests response = requests.post( "https://api.link.sc/v1/search", headers={ "Content-Type": "application/json", "x-api-key": "lsc_your_api_key", }, json={ "q": "latest NVIDIA earnings", "engine": "google", }, ) data = response.json() serp = data["serpData"] # Organic results for result in serp["results"]: print(f"#{result['realPosition']} {result['title']}") print(f" {result['targetUrl']}") print(f" {result['description']}\n") # People Also Ask if serp.get("peopleAlsoAsk"): print("People Also Ask:") for paa in serp["peopleAlsoAsk"]: print(f" - {paa['question']}")
JavaScript / Node.js
Codeconst response = await fetch("https://api.link.sc/v1/search", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": "lsc_your_api_key", }, body: JSON.stringify({ q: "latest NVIDIA earnings", engine: "google", }), }); const data = await response.json(); const { results, peopleAlsoAsk, ads } = data.serpData; // Organic results results.forEach((r) => { console.log(`#${r.realPosition} ${r.title}`); console.log(` ${r.targetUrl}`); }); // People Also Ask peopleAlsoAsk?.forEach((paa) => { console.log(`Q: ${paa.question}`); });
Go
Codepackage main import ( "bytes" "encoding/json" "fmt" "net/http" "io" ) type SerpResult struct { Title string `json:"title"` TargetUrl string `json:"targetUrl"` Description string `json:"description"` RealPosition int `json:"realPosition"` } type SerpData struct { Results []SerpResult `json:"results"` PeopleAlsoAsk []struct { Question string `json:"question"` } `json:"peopleAlsoAsk"` } type SearchResponse struct { SerpData SerpData `json:"serpData"` SearchEngine string `json:"searchEngine"` } func main() { body, _ := json.Marshal(map[string]string{ "q": "latest NVIDIA earnings", "engine": "google", }) req, _ := http.NewRequest("POST", "https://api.link.sc/v1/search", bytes.NewBuffer(body)) req.Header.Set("Content-Type", "application/json") req.Header.Set("x-api-key", "lsc_your_api_key") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() result, _ := io.ReadAll(resp.Body) var data SearchResponse json.Unmarshal(result, &data) for _, r := range data.SerpData.Results { fmt.Printf("#%d %s\n %s\n\n", r.RealPosition, r.Title, r.TargetUrl) } }
Using with Bing
Switch the search engine by setting "engine": "bing":
Codecurl -X POST https://api.link.sc/v1/search \ -H "Content-Type: application/json" \ -H "x-api-key: lsc_your_api_key" \ -d '{"q": "best AI APIs 2026", "engine": "bing"}'
Error Handling
All errors return a JSON object with error and message fields:
Code{ "error": "UNAUTHORIZED", "message": "API key required" }
| Status | Error Code | Meaning |
|---|---|---|
| 400 | MISSING_URL / MISSING_QUERY | Required parameter missing |
| 401 | UNAUTHORIZED / INVALID_KEY | Bad or missing API key |
| 403 | QUOTA_EXCEEDED | Monthly limit reached |
| 502 | EXTRACTION_FAILED | Upstream fetch error |
Last modified on