Skip to content
Scrappa Get API key
LinkedIn API 1 credit/request

LinkedIn Posts Search

GET https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10

Search public LinkedIn posts by keyword and return post URLs with titles, snippets, and numeric activity IDs. One upstream search per request, and no LinkedIn page is fetched: use the LinkedIn Post Transcript endpoint to enrich a specific post with its comments. The response paginates: pagination.current_page is the page that was served, and you request the next one with the page parameter. pagination.pages is reserved by the shared search backend and is currently always empty, so use current_page rather than it. pagination.source reads derived_from_request when the page block was built from your request rather than reported by the search engine. total_results is the engine estimate for the whole query, not for this page, and people_also_search_for carries related queries when the engine offers them. The upstream search provider serves a window of 190 results at most, so the last page starts where that window ends: page 10 with num=20 overlaps the previous page instead of coming back empty for a combination this endpoint accepts.The Errors section lists the common cases rather than every code: any failed request carries an error_code, and none of them is billed.

LinkedIn Posts Search 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10
Auth header
x-api-key
Cost
1 credit/request
query = artificial intelligence hiring
Response preview
200 OK
{
    "organic_results": [
        {
            "position": 1,
            "title": "Why we are hiring for AI roles in 2026",
            "link": "https://www.linkedin.com/posts/john-doe_hiring-for-ai-roles-activity-7123456789012345678",
            "displayed_link": "linkedin.com \u203a posts \u203a john-doe",
            "snippet": "We are opening three roles on the applied AI team...",
            "activity_id": "7123456789012345678"
        }
    ],
    "search_information": {
        "query_displayed": "artificial intelligence hiring",
        "total_results": 1
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

7 optional filters available.

query string Required

Search phrase.

Example value artificial intelligence hiring
num integer Optional

Results per page (1-20, default 10).

Example value 10
page integer Optional

Page number (1-based).

Example value 1
hl string Optional

Interface language (e.g., en, de).

Example value en
gl string Optional

2-letter country code for geolocation (e.g., us, de).

Example value us
cr string Optional

Restrict results to a country (format: countryXX).

Example value countryUS
safe string Optional

Adult content filtering (active or off).

Example value off
filter integer Optional

Enable/disable duplicate filtering (0 or 1).

Example value 1

Request Examples

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-api-key: YOUR_API_KEY_HERE"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
PHP
<?php

use Illuminate\Support\Facades\Http;

$response = Http::timeout(30)
    ->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
    ->get('https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10');

if ($response->successful()) {
    echo $response->body();
} else {
    echo "Error: " . $response->status();
}
JavaScript
const options = {
    method: 'GET',
    headers: {
        'x-api-key': 'YOUR_API_KEY_HERE'
    }
};

fetch('https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10', options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        return response.text();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
JavaScript
const axios = require('axios');

const options = {
    method: 'GET',
    url: 'https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10',
    headers: {
        x-api-key: 'YOUR_API_KEY_HERE',
    }
};

try {
    const response = await axios(options);
    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
Ruby
require 'net/http'
require 'uri'

uri = URI.parse("https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'

request = Net::HTTP::Get.new(uri.request_uri)
request['x-api-key'] = 'YOUR_API_KEY_HERE'

begin
    response = http.request(request)
    puts response.body
rescue => e
    puts "Error: #{e.message}"
end
Python
import http.client
import json

conn = http.client.HTTPSConnection("scrappa.co")

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    conn.request("GET", "/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10", headers=headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
except Exception as e:
    print(f"Error: {e}")
finally:
    conn.close()
Python
import requests

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    response = requests.get('https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10', headers=headers)
    response.raise_for_status()
    print(response.text)
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
Java
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class ApiExample {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10")
        .addHeader("x-api-key", "YOUR_API_KEY_HERE")
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                System.out.println(response.body().string());
            } else {
                System.out.println("Error: " + response.code());
            }
        } catch (IOException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Go
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10", nil)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }
    req.Header.Set("x-api-key", "YOUR_API_KEY_HERE")

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println("Error reading response:", err)
        return
    }

    fmt.Println(string(body))
}
Terminal
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10"
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY_HERE");

        try
        {
            var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10"));
            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }
}
TypeScript
import axios from 'axios';

async function run(): Promise<void> {
    try {
        const response = await axios({
            method: 'GET',
            url: 'https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10',
            headers: {
        'x-api-key': 'YOUR_API_KEY_HERE',
            },
        });

        console.log(response.data);
    } catch (error) {
        console.error('Error:', error);
    }
}

void run();
RUST
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .get("https://scrappa.co/api/linkedin/posts/search?query=artificial+intelligence+hiring&num=10")
        .header("x-api-key", "YOUR_API_KEY_HERE")
        .send()
        .await?;

    println!("{}", response.text().await?);

    Ok(())
}

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

organic_results search_information pagination total_results people_also_search_for

Common organic_results fields

position title link displayed_link
JSON Response
200 OK
{
    "organic_results": [
        {
            "position": 1,
            "title": "Why we are hiring for AI roles in 2026",
            "link": "https://www.linkedin.com/posts/john-doe_hiring-for-ai-roles-activity-7123456789012345678",
            "displayed_link": "linkedin.com \u203a posts \u203a john-doe",
            "snippet": "We are opening three roles on the applied AI team...",
            "activity_id": "7123456789012345678"
        }
    ],
    "search_information": {
        "query_displayed": "artificial intelligence hiring",
        "total_results": 1
    },
    "pagination": {
        "current_page": 1,
        "pages": [],
        "source": "derived_from_request"
    },
    "total_results": 1,
    "people_also_search_for": []
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

The query parameter is missing, or num/page are out of range.

{
    "message": "The request validation failed",
    "errors": {
        "query": [
            "The query field is required."
        ]
    }
}
404

No Posts Found

No LinkedIn post URLs matched this query. Not billed.

{
    "success": false,
    "message": "No LinkedIn posts matched this query.",
    "status_code": 404,
    "error_code": "linkedin_posts_search_no_matches"
}
503

Search Unavailable

The shared search backend could not be reached or returned no usable result set. Failed requests are never billed.

{
    "success": false,
    "message": "LinkedIn post search is temporarily unavailable. Please try again.",
    "status_code": 503,
    "error_code": "linkedin_posts_search_upstream_error"
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Related LinkedIn API docs

Try It Live

Test this endpoint in our interactive playground with real data.