APIs / Stack Overflow / Search

Stack Overflow: Search

Search from Stack Overflow as JSON. 1 credit per successful call.

GET /v1/stackoverflow/search

Parameters

Send parameters in the query string.

Required Send q or tagged.

ParameterTypeRequiredAllowed values
qstringOptionalUp to 200 characters
taggedstringOptionalUp to 200 characters
sortstringOptionalactivity, votes, creation, relevance
orderstringOptionalasc, desc
pageintegerOptionalAny
pagesizeintegerOptionalAny

Example request

Stack Overflow
GET/v1/stackoverflow/search?q=laravel+queue&tagged=php&sort=votes
{
  "success": true,
  "data": {
    "search_parameters": {
      "q": "laravel queue",
      "tagged": "php",
      "sort": "votes",
      "order": "desc"
    },
    "questions": [
      {
        "question_id": 25877752,
        "title": "Laravel queue process timeout error",
        "link": "https://stackoverflow.com/questions/25877752/laravel-queue-process-timeout-error",
        "tags": [
          "php",
          "symfony",
          "laravel"
        ],
        "score": 82,
        "view_count": 112277,
        "answer_count": 4,
        "comment_count": 5,
        "is_answered": true,
        "accepted_answer_id": 26238686,
        "created_at": "2014-09-16T20:21:27Z",
        "last_activity_at": "2022-12-24T01:39:22Z",
        "owner": {
          "user_id": 1512641,
          "display_name": "Will Durney",
          "reputation": 1258,
          "user_type": "registered",
          "accept_rate": 86,
          "link": "https://stackoverflow.com/users/1512641/will-durney",
          "profile_image": "https://www.gravatar.com/avatar/76b63456d16d4c9877f9c590487fc755?s=256&d=identicon&r=PG"
        },
        "body": "<p>I'm on Laravel using <code>php artisan queue:listen</code> to run queued jobs. One of these jobs is fairly involved and takes a long time, and so I'm getting the following error:</p>\n\n<pre><code>[Symfony\\Component\\Process\\Exception\\Proce…",
        "body_text": "I'm on Laravel using php artisan queue:listen to run queued jobs. One of these jobs is fairly involved and takes a long time, and so I'm getting the following error:\n\n[Symfony\\Component\\Process\\Exception\\ProcessTimedOutException] \nThe proce…"
      },
      {
        "question_id": 33457639,
        "title": "How to inject dependencies to a laravel job",
        "link": "https://stackoverflow.com/questions/33457639/how-to-inject-dependencies-to-a-laravel-job",
        "tags": [
          "php",
          "laravel",
          "laravel-5"
        ],
        "score": 43,
        "view_count": 27151,
        "answer_count": 4,
        "comment_count": 0,
        "is_answered": true,
        "accepted_answer_id": 33458379,
        "created_at": "2015-10-31T23:17:31Z",
        "last_activity_at": "2024-09-04T10:04:47Z",
        "owner": {
          "user_id": 2561122,
          "display_name": "Acho Arnold",
          "reputation": 1263,
          "user_type": "registered",
          "accept_rate": 50,
          "link": "https://stackoverflow.com/users/2561122/acho-arnold",
          "profile_image": "https://www.gravatar.com/avatar/2e59fc57acb64eed70c958f4e1ad5e60?s=256&d=identicon&r=PG"
        },
        "body": "<p>I'm adding a laravel job to my queue from my controller as such</p>\n\n<pre><code>$this-&gt;dispatchFromArray(\n    'ExportCustomersSearchJob',\n    [\n        'userId' =&gt; $id,\n        'clientId' =&gt; $clientId\n    ]\n);\n</code></pre>\n\n<p>…",
        "body_text": "I'm adding a laravel job to my queue from my controller as such\n\n$this->dispatchFromArray(\n 'ExportCustomersSearchJob',\n [\n 'userId' => $id,\n 'clientId' => $clientId\n ]\n);\n\nI would like to inject the userRepository as a dependency when impl…"
      },
      {
        "question_id": 35412779,
        "title": "How to get all pending jobs in laravel queue on redis?",
        "link": "https://stackoverflow.com/questions/35412779/how-to-get-all-pending-jobs-in-laravel-queue-on-redis",
        "tags": [
          "php",
          "laravel",
          "redis"
        ],
        "score": 41,
        "view_count": 89443,
        "answer_count": 7,
        "comment_count": 0,
        "is_answered": true,
        "accepted_answer_id": 42182586,
        "created_at": "2016-02-15T15:11:26Z",
        "last_activity_at": "2022-01-06T18:47:07Z",
        "last_edited_at": "2022-01-06T18:44:02Z",
        "owner": {
          "user_id": 978690,
          "display_name": "rap-2-h",
          "reputation": 32408,
          "user_type": "registered",
          "accept_rate": 94,
          "link": "https://stackoverflow.com/users/978690/rap-2-h",
          "profile_image": "https://i.sstatic.net/lNUl6.png?s=256"
        },
        "body": "<p>The <code>queue:listen</code> was not run on a server, so some jobs were pushed (using Redis driver) but never run.</p>\n<p>How could I count (or get all) these jobs? I did not find any artisan command to get this information.</p>\n",
        "body_text": "The queue:listen was not run on a server, so some jobs were pushed (using Redis driver) but never run.\n\nHow could I count (or get all) these jobs? I did not find any artisan command to get this information."
      }
    ],
    "page": 1,
    "pagesize": 30,
    "has_more": true
  },
  "meta": {
    "endpoint_family": "search",
    "request_id": "req_b24552b89e2e488a83c3127fdc0cfd19",
    "credits_charged": 1,
    "credits_remaining": 1778
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Run this endpoint in the playground with your own parameters. 1 credit per successful call; failed calls are free.

Response fields

data has these 3 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

FieldType
search_parametersobject
questionsobject[]
pagesizeinteger