-
Notifications
You must be signed in to change notification settings - Fork 194
API docs
The API itself is in its very early stages. Everything will change, but here are some sample URLs to play with.
- All URLs return JSON
- For pretty JSON, pass the pretty parameter. eg pretty=true
- To limit your results, pass the size parameter. eg size=100000
- To limit the fields returned, pass a comma-separated list in the fields param. eg fields=_source.distvname,_source.name
- To return no fields, just pass the fields param without values. eg fields=&
http://api.metacpan.org/pod/_search?&fields=&q=text:rjbs&size=10
Note that this query returns no Pod fields because of the empty "fields" param.
[[http://api.metacpan.org/pod/_search?&fields=&q=text:rjb&size=10]]
Note that this query returns no Pod fields because of the empty "fields" param.
http://api.metacpan.org/pod/_search?&fields=_source.text&q=rjbs&size=10
http://api.metacpan.org/pod/_search?&fields=_source.html&q=rjbs&size=10
http://api.metacpan.org/module/Dancer::Cookbook
http://api.metacpan.org/module/_search?q=distname:moose
Note that for this type of search, the author id must be in lower case.
http://api.metacpan.org/module/_search?q=author:oalders
Alternate syntax:
curl -XPOST 'api.metacpan.org/module/_search?pretty=true' -d '{
"query" : {
"term" : { "author" : "oalders" }
}
}
'
Using the "field" key, the search term becomes case-insensitive:
curl -XPOST 'api.metacpan.org/module/_search?pretty=true' -d '{
"query" : {
"field" : { "author" : "Oalders" }
}
}
'
http://api.metacpan.org/module/_search?q=*&size=100000
Same list, but return only "name" and "distvname" fields: http://api.metacpan.org/module/_search?&fields=_source.distvname,_source.name&q=*&size=100000
http://api.metacpan.org/author/DROLSKY
http://api.metacpan.org/author/_search?q=author:D*
http://api.metacpan.org/author/_search?q=name:Dave
http://api.metacpan.org/author/_search?q=name:%22dave%20rolsky%22
http://api.metacpan.org/author/_search?pretty=true&q=*&size=100000
http://api.metacpan.org/pod/HTML::Restrict