@@ -22,3 +22,128 @@ The `/api/article` endpoints return information about a page by `pathname`.
2222For internal folks ask in the Docs Engineering slack channel.
2323
2424For open source folks, please open a discussion in the public repository.
25+
26+ <!-- API reference docs automatically generated, do not edit below this comment -->
27+ ## Reference: API endpoints
28+
29+ ### GET /api/article/
30+
31+ Get article metadata and content in a single object. Equivalent to calling ` /article/meta ` concatenated with ` /article/body ` .
32+
33+ ** Parameters** :
34+ - ** pathname** (string) - Article path (e.g. '/en/get-started/article-name')
35+
36+ ** Returns** : (object) - JSON object with article metadata and content (` meta ` and ` body ` keys)
37+
38+ ** Throws** :
39+ - (Error): 403 - If the article body cannot be retrieved. Reason is given in the error message.
40+ - (Error): 400 - If pathname parameter is invalid.
41+ - (Error): 404 - If the path is valid, but the page couldn't be resolved.
42+
43+ ** Example** :
44+ ```
45+ ❯ curl -s "https://docs.github.com/api/article?pathname=/en/get-started/start-your-journey/about-github-and-git"
46+ {
47+ "meta": {
48+ "title": "About GitHub and Git",
49+ "intro": "You can use GitHub and Git to collaborate on work.",
50+ "product": "Get started"
51+ },
52+ "body": "## About GitHub\n\nGitHub is a cloud-based platform where you can store, share, and work together with others to write code.\n\nStoring your code in a \"repository\" on GitHub allows you to:\n\n* **Showcase or share** your work.\n [...]"
53+ }
54+ ```
55+
56+ ---
57+
58+ ### GET /api/article/body
59+
60+ Get the contents of an article's body.
61+
62+ ** Parameters** :
63+ - ** pathname** (string) - Article path (e.g. '/en/get-started/article-name')
64+
65+ ** Returns** : (string) - Article body content in markdown format.
66+
67+ ** Throws** :
68+ - (Error): 403 - If the article body cannot be retrieved. Reason is given in the error message.
69+ - (Error): 400 - If pathname parameter is invalid.
70+ - (Error): 404 - If the path is valid, but the page couldn't be resolved.
71+
72+ ** Example** :
73+ ```
74+ ❯ curl -s https://docs.github.com/api/article/body\?pathname=/en/get-started/start-your-journey/about-github-and-git
75+ ## About GitHub
76+
77+ GitHub is a cloud-based platform where you can store, share, and work together with others to write code.
78+
79+ Storing your code in a "repository" on GitHub allows you to:
80+ [...]
81+ ```
82+
83+ ---
84+
85+ ### GET /api/article/meta
86+
87+ Get metadata about an article.
88+
89+ ** Parameters** :
90+ - ** pathname** (string) - Article path (e.g. '/en/get-started/article-name')
91+
92+ ** Returns** : (object) - JSON object containing article metadata with title, intro, and product information.
93+
94+ ** Throws** :
95+ - (Error): 400 - If pathname parameter is invalid.
96+ - (Error): 404 - If the path is valid, but the page couldn't be resolved.
97+
98+ ** Example** :
99+ ```
100+ ❯ curl -s "https://docs.github.com/api/article/meta?pathname=/en/get-started/start-your-journey/about-github-and-git"
101+ {
102+ "title": "About GitHub and Git",
103+ "intro": "You can use GitHub and Git to collaborate on work.",
104+ "product": "Get started",
105+ "breadcrumbs": [
106+ {
107+ "href": "/en/get-started",
108+ "title": "Get started"
109+ },
110+ {
111+ "href": "/en/get-started/start-your-journey",
112+ "title": "Start your journey"
113+ },
114+ {
115+ "href": "/en/get-started/start-your-journey/about-github-and-git",
116+ "title": "About GitHub and Git"
117+ }
118+ ]
119+ }
120+ ```
121+
122+ ---
123+
124+ ### GET /api/pagelist/: lang /: productVersion
125+
126+ A list of pages available for a fully qualified path containing the target language and product version.
127+
128+ ** Parameters** :
129+ - ** lang** (string) - Path parameter for language code (e.g. 'en')
130+ - ** productVersion** (string) - Path parameter for product version (e.g. 'free-pro-team@latest')
131+
132+ ** Returns** : (string) - List of paths matching the language and version
133+
134+ ** Throws** :
135+ - (Error): 400 - If language or version parameters are invalid. Reason is given in the error message.
136+
137+ ** Example** :
138+ ```
139+ ❯ curl -s https://docs.github.com/api/pagelist/en/free-pro-team@latest
140+ /en
141+ /en/search
142+ /en/get-started
143+ /en/get-started/start-your-journey
144+ /en/get-started/start-your-journey/about-github-and-git
145+ [...]
146+ ```
147+
148+ ---
149+
0 commit comments