Skip to content

Devdocs search API #1616

@Explosion-Scratch

Description

@Explosion-Scratch

I love how devdocs does searching client side (allowing users to download documentation), but it would be very useful to have a unified API for devdocs, what I'm thinking of would be something like this:

//Searches all documentation in all programming languages
// Also parameters such as "languages=javascript,css,html" and "matchingcutoff=.5" to adjust stuff.
GET /api/search?q=pop
{
  "results": [
    {
      "path": "javascript/global_objects/array/pop",
      "icon": "https://devdocs.io/assets/javascript.png",
      "language": "javascript",
      "provider": "MDN",
      "provider_url": "https://developer.mozilla.org/",
      "version": "[version string]"
    }
  ]
}
//Returns entire JavaScript documentation
GET /api/documentation/javascript
{
  //Would be an array of article objects (below)
  "entries": [...]
}
//Get a specific article by ID
GET /api/article?id=javascript%2Fglobal_objects%2Farray%2Fpop
{
	"language": "JavaScript",
    "updated": "2021-10-03T21:24:33.706Z",
    "provider": "mdn",
    "provider_url": "https://developer.mozilla.org",
    "original_url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop",
    "body": "[HTML here]",
    "version": "[version]",
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions