{"basePath":"/service/linkrecommendation/","definitions":{"DatasetChecksums":{"properties":{"anchors":{"description":"Checksum value for the anchors dataset","example":"ab0a4c3fc5dcf9e6404c45eaad1eb463b38673a4936ab3f80e7dcdbf8130dee5","type":"string"},"model":{"description":"Checksum value for the model dataset","example":"c25a9fb36577a272dd7ca101655d6169bf8a86dbfb1edce7c9b6ee445dec8e71","type":"string"},"pageids":{"description":"Checksum value for the pageids dataset","example":"05391e1229aefc087c5076bea2042cddcc0d23bded0f6262cc474898a954c96e","type":"string"},"redirects":{"description":"Checksum value for the redirects dataset","example":"56e8089b9d930b4ff77dbc9495c6a2e67c48d8d8a023f9b148e3bbfe5a98665f","type":"string"},"w2vfiltered":{"description":"Checksum value for the w2vfiltered dataset","example":"59cb88563ca2e0d1992d71d28921f04e902880a9bc9d03081360cbef69fa229c","type":"string"}},"type":"object"},"LinkRecommendation":{"properties":{"context_after":{"description":"Characters immediately succeeding the link text, in plain text. May include spaces, punctuation, and partial words","example":", které js","type":"string"},"context_before":{"description":"Characters immediately preceding the link text, in plain text. May include spaces, punctuation, and partial words","example":" v ","type":"string"},"link_index":{"description":"0-based index of the link recommendation within all link recommendations, sorted by wikitext offset","example":1,"type":"integer"},"link_target":{"description":"Article title to link to","example":"Povrchový důl","type":"string"},"link_text":{"description":"Phrase to link in the article text","example":"povrchových dolech","type":"string"},"match_index":{"description":"0-based index of the link anchor within the list of matches when searching for the phrase to link within simple wikitext (top-level wikitext that's not part of any kind of wikitext construct)\n","example":0,"type":"integer"},"score":{"description":"Probability score that the link should be added","example":0.5150544047355652,"type":"number"},"wikitext_offset":{"description":"Character offset describing where the anchor begins","example":2379,"type":"integer"}},"type":"object"},"LinkRecommendationSet":{"properties":{"links":{"description":"Array of link recommendation objects","items":{"$ref":"#/definitions/LinkRecommendation"},"type":"array"},"links_count":{"description":"Number of link recommendations","example":5,"type":"integer"},"meta":{"$ref":"#/definitions/Meta"},"page_title":{"description":"Wiki page title","example":"Lipsko","type":"string"},"pageid":{"description":"Page identifier","example":23151,"type":"integer"},"revid":{"description":"Revision identifier","example":25567649,"type":"integer"}},"type":"object"},"Meta":{"properties":{"application_version":{"description":"Git commit hash associated with the application that generated the response","example":"2fe11bb","type":"string"},"dataset_checksums":{"$ref":"#/definitions/DatasetChecksums"},"format_version":{"description":"Format version for the response","example":1,"type":"integer"}},"type":"object"},"Unauthorized":{"properties":{"httpCode":{"description":"Response code","example":401,"type":"integer"},"httpReason":{"description":"Reason for the error response","example":"Jwt is missing","type":"string"}},"type":"object"}},"externalDocs":{"description":"Documentation","url":"https://www.mediawiki.org/wiki/Special:MyLanguage/Link_Recommendation_API"},"info":{"contact":{"name":"Link Recommendation API Talk Page","url":"https://www.mediawiki.org/wiki/Talk:Link_Recommendation_API"},"description":"Link Recommendation API suggests places in an article where a link could be added. This helps guide editors in the important work of creating connections between different topics.\n","license":{"name":"Creative Commons Attribution-Share Alike 4.0","url":"https://creativecommons.org/licenses/by-sa/4.0/"},"termsOfService":"https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use#12._API_Terms","title":"Wikimedia Link Recommendation API","version":"1.0.0"},"paths":{"/v1/linkrecommendations/{project}/{domain}/{page_title}":{"get":{"description":"Returns a set of possible links that can be added to improve an article on Wikipedia.","operationId":"getLinkRecommendations","parameters":[{"description":"Project name. Only \"wikipedia\" is supported","in":"path","name":"project","required":true,"type":"string"},{"description":"Project subdomain, usually the language code. For example: \"en\" for English Wikipedia. The majority of [Wikipedia subdomains](https://meta.wikimedia.org/wiki/Special:SiteMatrix) are supported. Unsupported subdomains return a 404 error.","in":"path","name":"domain","required":true,"type":"string"},{"description":"Wiki page title","in":"path","name":"page_title","required":true,"type":"string"},{"description":"Language code (ISO-639) to use with the request. Defaults to the domain parameter","in":"query","name":"language_code","required":false,"type":"string"},{"description":"Revision identifier. Defaults to the latest revision","in":"query","name":"revision","required":false,"type":"number"},{"default":0.5,"description":"Number between 0 and 1 for the threshold to use","in":"query","name":"threshold","required":false,"type":"number"},{"description":"Sections to exclude from link suggestion generation. Exact match is used. To exclude the lead section, use %LEAD%","in":"query","items":{"type":"string"},"name":"sections_to_exclude","required":false,"type":"array"},{"default":15,"description":"Maximum number of recommendations to return","in":"query","name":"max_recommendations","required":false,"type":"number"}],"responses":{"200":{"description":"Success: Page found","schema":{"$ref":"#/definitions/LinkRecommendationSet"}}},"summary":"Get link recommendations","x-amples":[{"request":{"params":{"domain":"cs","page_title":"Lipsko","project":"wikipedia"},"query":{"language_code":"cs","max_recommendations":1,"threshold":0.1},"response":{"body":{"page_title":"Lipsko"},"meta":{"format_version":1},"status":200}}}],"x-monitor":true},"post":{"description":"Returns a set of possible links that can be added to improve an article on Wikipedia based on information about the page, revision, or custom wikitext input.","operationId":"getLinkRecommendationsForRevision","parameters":[{"description":"Project name. Only \"wikipedia\" is supported","in":"path","name":"project","required":true,"type":"string"},{"description":"Project subdomain, usually the language code. For example: \"en\" for English Wikipedia. The majority of [Wikipedia subdomains](https://meta.wikimedia.org/wiki/Special:SiteMatrix) are supported. Unsupported subdomains return a 404 error","in":"path","name":"domain","required":true,"type":"string"},{"description":"Wiki page title","in":"path","name":"page_title","required":true,"type":"string"},{"description":"Language code (ISO-639) to use with the request. Defaults to the domain parameter","in":"query","name":"language_code","required":false,"type":"string"},{"default":0.5,"description":"Number between 0 and 1 for the threshold to use","in":"query","name":"threshold","required":false,"type":"number"},{"description":"Sections to exclude from link suggestion generation. Exact match is used. To exclude the lead section, use %LEAD%","in":"query","items":{"type":"string"},"name":"sections_to_exclude","required":false,"type":"array"},{"default":15,"description":"Maximum number of recommendations to return","in":"query","name":"max_recommendations","required":false,"type":"number"},{"description":"Request body","in":"body","name":"body","required":true,"schema":{"example":{"pageid":23151,"revid":25567649,"wikitext":"{{Infobox - sídlo světa..."},"properties":{"pageid":{"description":"Page identifier","type":"integer"},"revid":{"description":"Revision identifier","type":"integer"},"sections_to_exclude":{"description":"Sections to exclude from link suggestion generation. Exact match is used. To exclude the lead section, use %LEAD%","items":{"type":"string"},"type":"array"},"wikitext":{"description":"Raw wikitext of the page","type":"string"}},"required":["wikitext","revid","pageid"]}}],"responses":{"200":{"description":"Success: Page found","schema":{"$ref":"#/definitions/LinkRecommendationSet"}},"401":{"description":"Error: Unauthorized","schema":{"$ref":"#/definitions/Unauthorized"}}},"security":[{"Authorization":[]}],"summary":"Get link recommendations for revision","x-amples":[{"request":{"body":{"pageid":23151,"revid":25567649,"wikitext":"{{Infobox - sídlo světa..."},"headers":{"Content-Type":"application/json"},"params":{"domain":"cs","page_title":"Lipsko","project":"wikipedia"},"query":{"language_code":"cs","max_recommendations":1,"threshold":0.1},"response":{"body":{"links_count":1,"meta":{"format_version":1},"page_title":"Lipsko","pageid":23151,"revid":25567649},"status":200}}}],"x-monitor":true}}},"securityDefinitions":{"Authorization":{"description":"Authorization header using the Bearer scheme. Example: \"Bearer {token}\"","in":"header","name":"Authorization","type":"apiKey"}},"swagger":"2.0"}
