@@ -7,23 +7,6 @@ title: Search | GitHub API
77* TOC
88{: toc }
99
10- ### Preview mode
11-
12- <div class =" alert " >
13- <p >
14- The Search API is currently available for developers to preview.
15- During the preview period, the API may change without advance notice.
16- Please see the <a href="/changes/2013-07-19-preview-the-new-search-api">blog post</a> for full details.
17- </p >
18- <p >
19- To access the API during the preview period, you must provide a custom <a href="/v3/media">media type</a> in the <code>Accept</code> header:
20- <pre>application/vnd.github.preview</pre>
21- </p >
22- </div >
23-
24- If you have any questions or feedback about this new API, please [ get in
25- touch] ( https://github.com/contact?form[subject]=New+Search+API ) .
26-
2710### About the Search API
2811
2912The Search API is optimized to help you find the specific item you're looking
@@ -105,7 +88,7 @@ use case. To get this metadata in your search results, specify the `text-match`
10588media type in your Accept header. For example, via curl, the above query would
10689look like this:
10790
108- curl -H 'Accept: application/vnd.github.preview .text-match+json' \
91+ curl -H 'Accept: application/vnd.github.v3 .text-match+json' \
10992 https://api.github.com/search/repositories?q=tetris+language:assembly&sort=stars&order=desc
11093
11194This produces the same JSON payload as above, with an extra key called
@@ -179,7 +162,7 @@ use case. To get this metadata in your search results, specify the `text-match`
179162media type in your Accept header. For example, via curl, the above query would
180163look like this:
181164
182- curl -H 'Accept: application/vnd.github.preview .text-match+json' \
165+ curl -H 'Accept: application/vnd.github.v3 .text-match+json' \
183166 https://api.github.com/search/code?q=addClass+in:file+language:js+@jquery/jquery
184167
185168This produces the same JSON payload as above, with an extra key called
@@ -258,7 +241,7 @@ use case. To get this metadata in your search results, specify the `text-match`
258241media type in your Accept header. For example, via curl, the above query would
259242look like this:
260243
261- curl -H 'Accept: application/vnd.github.preview .text-match+json' \
244+ curl -H 'Accept: application/vnd.github.v3 .text-match+json' \
262245 https://api.github.com/search/issues?q=windows+label:bug+language:python+state:open&sort=created&order=asc
263246
264247This produces the same JSON payload as above, with an extra key called
@@ -327,7 +310,7 @@ use case. To get this metadata in your search results, specify the `text-match`
327310media type in your Accept header. For example, via curl, the above query would
328311look like this:
329312
330- curl -H 'Accept: application/vnd.github.preview .text-match+json' \
313+ curl -H 'Accept: application/vnd.github.v3 .text-match+json' \
331314 https://api.github.com/search/users?q=tom+repos:%3E42+followers:%3E1000
332315
333316This produces the same JSON payload as above, with an extra key called
@@ -355,7 +338,7 @@ by numeric offsets identifying the exact location of each matching search term.
355338To get this metadata in your search results, specify the ` text-match ` media type
356339in your Accept header.
357340
358- application/vnd.github.preview .text-match+json
341+ application/vnd.github.v3 .text-match+json
359342
360343The results will provide the same JSON payloads as shown above, with an extra
361344key called ` text_matches ` . Inside the ` text_matches ` array, each hash includes
@@ -383,7 +366,7 @@ matches
383366Using curl, and the [ example issue search] ( #issue-search-example ) above, our API
384367request would look like this:
385368
386- curl -H 'Accept: application/vnd.github.preview .text-match+json' \
369+ curl -H 'Accept: application/vnd.github.v3 .text-match+json' \
387370 https://api.github.com/search/issues?q=windows+label:bug+language:python+state:open&sort=created&order=asc
388371
389372The response will include a ` text_matches ` array for each search result. In the
0 commit comments