forked from 18F/fbopen-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapidocs.html
220 lines (215 loc) · 18.4 KB
/
apidocs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!DOCTYPE html><html><head><meta charset="utf-8"><title>FBOpen API</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200">
<style>/* Highlight.js Theme Tomorrow */
.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript .hljs-title,.coffeescript .hljs-title{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{display:block;background:white;color:#4d4d4c;padding:.5em}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}</style><style>body,
h4,
h5 {
font-family: 'Helvetica Neue' sans-serif !important;
}
h1,
h2,
h3,
.aglio {
font-family: 'Helvetica Neue' sans-serif !important;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a {
display: none;
}
h1:hover a,
h2:hover a,
h3:hover a,
h4:hover a,
h5:hover a {
display: inline;
}
code {
color: #444;
background-color: #ddd;
font-family: 'Inconsolata' monospace !important;
}
a[data-target] {
cursor: pointer;
}
h4 {
font-size: 100%;
font-weight: bold;
text-transform: uppercase;
}
.back-to-top {
position: fixed;
z-index: 1;
bottom: 0px;
right: 24px;
padding: 4px 8px;
background-color: #eee;
text-decoration: none !important;
border-top: 1px solid rgba(0,0,0,0.1);
border-left: 1px solid rgba(0,0,0,0.1);
border-right: 1px solid rgba(0,0,0,0.1);
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.panel {
overflow: hidden;
}
.panel-heading code {
color: #c7254e;
background-color: transparent;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.panel-heading h3 {
margin-top: 10px;
margin-bottom: 10px;
}
a.list-group-item {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
a.list-group-item.heading {
background-color: #f5f5f5;
}
.list-group-item.collapse {
display: none;
}
.list-group-item.collapse.in {
display: block;
}
#nav {
margin-top: 38px;
min-width: 255px;
top: 0;
bottom: 0;
padding-right: 12px;
padding-bottom: 12px;
overflow-y: auto;
}
@media (max-width: 1199px) {
#nav {
min-width: 212px;
}
}
</style>
</head>
<body>
<a href="#top" class="text-muted back-to-top"><i class="fa fa-toggle-up"></i> Back to top</a>
<div class="container">
<div class="row">
<div class="col-md-3">
<nav id="nav" class="hidden-sm hidden-xs affix nav">
<div class="list-group">
<a href="/fbopen-docs"><img width="200px" src="/fbopen-docs/assets/fbopen.png"></a><br/><br/>
<h3><strong>FBOpen Docs</strong></h3>
<p><a href="/fbopen-docs">FBOpen Docs Home</a></p><br/>
<a href="#" class="list-group-item heading">Resource Group</a>
<a href="#-all-opportunities" class="list-group-item"><i class="fa fa-arrow-circle-down"></i> All Opportunities</a><a href="#-an-opportunity" class="list-group-item"><i class="fa fa-plus-square"></i> An Opportunity</a></div></nav></div><div class="col-md-9"><div><header><div class="page-header">
<h3 id="top">FBOpen API Documentation</h3>
</div>
</header>
<div class="description">
<p>This is the API documentation for the FBOpen API, a search API of opportunities to work with the U.S. government. <a href="/fbopen-docs">You can learn more about FBOpen and its data by returning to the main documentation page.</a></p>
<p>The API is hosted through <a href="https://api.data.gov">api.data.gov</a>. <strong>To use it, you’ll need to <a href="https://api.data.gov/signup">get a free API key</a>.</strong> During testing, you can use <strong>DEMO_KEY</strong>.</p>
<p>You can see our live front-end, built on this API, at <a href="https://fbopen.gsa.gov">fbopen.gsa.gov</a>.</p>
</div></div><div><div class="panel panel-default"><div class="panel-heading"><h3 id="">Resource Group <a href="#"><i class="fa fa-link"></i></a></h3></div><div class="panel-body"><h4 id="-all-opportunities">All Opportunities <a href="#-all-opportunities"><i class="fa fa-link"></i></a></h4><p>The index contains opportunities from FBO.gov and grants.gov (at present). The records and their attachments are searchable in full-text via our API.</p>
<section id="-all-opportunities-get" class="panel panel-info"><div class="panel-heading"><div style="float:right"><span style="text-transform: lowercase">Search</span></div><div style="float:left"><a href="#-all-opportunities-get" class="btn btn-xs btn-primary">GET</a></div><div style="overflow:hidden"><code>/gsa/fbopen/v0/opps{?q,api_key,data_source,limit,start,show_noncompeted,show_closed}</code></div></div><div class="panel-body"><p>Search for opportunities matching the query string (q). Supports <a href="http://lucene.apache.org/core/2_9_4/queryparsersyntax.html">Lucene query syntax</a>.</p>
<h5 id="here-are-a-couple-examples-to-get-started-">Here are a couple examples to get started:</h5>
<p>To query for the first page (i.e., the first ten results, numbers 0 through 9) of opportunities that mention software development:</p>
<pre><code><span class="hljs-label">https:</span>//api<span class="hljs-preprocessor">.data</span><span class="hljs-preprocessor">.gov</span>/gsa/fbopen/v0/opps?q=software+development&api_key=YOUR_API_KEY
</code></pre><p>To query the third page of grants that mention bioinformatics, including opportunities that have already closed (i..e, the due date has already passed):</p>
<pre><code><span class="hljs-label">https:</span>//api<span class="hljs-preprocessor">.data</span><span class="hljs-preprocessor">.gov</span>/gsa/fbopen/v0/opps?q=bioinformatics&data_source=grants<span class="hljs-preprocessor">.gov</span>&start=<span class="hljs-number">20</span>&show_closed=true&api_key=YOUR_API_KEY
</code></pre><p><br /></p>
</div><ul class="list-group"><li class="list-group-item bg-default"><strong>Parameters</strong></li><li class="list-group-item"><dl class="dl-horizontal"><dt>q</dt><dd><code>string</code> <span class="required">(required)</span> <p>the keyword(s) or phrase you want to search for. Supports <a href="http://lucene.apache.org/core/2_9_4/queryparsersyntax.html">Lucene query syntax</a>.</p>
</dd><dt>api_key</dt><dd><code>string</code> <span class="required">(required)</span> <p>your api.data.gov API key (<a href="https://api.data.gov/signup">sign up</a>)</p>
</dd><dt>data_source</dt><dd><code>string</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>all</span></span> <p>get results only from a particular data source. As of 2014-04-10, the available sources are ‘FBO’ and ‘grants.gov’. Case sensitive.</p>
</dd><dt>p</dt><dd><code>integer</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>1</span></span> <p>page (one-indexed) of results to return. Takes precedence over <code>start</code>, if given.</p>
</dd><dt>limit</dt><dd><code>integer</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>10</span></span> <p>number of results to return per request</p>
</dd><dt>start</dt><dd><code>integer</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>0</span></span> <p>get the next [limit] results starting with this number (zero-indexed)</p>
</dd><dt>show_noncompeted</dt><dd><code>true/false</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>false</span></span> <p>include sole-sourced or otherwise non-competed opportunities in the results</p>
</dd><dt>show_closed</dt><dd><code>true/false</code> <span>(optional)</span> <span class="text-info default"><strong>Default: </strong><span>false</span></span> <p>include opportunities with deadlines that have already passed in the results</p>
</dd></dl></li></ul><ul class="list-group"><li class="list-group-item">
<strong>Response <code>200</code></strong><a data-toggle="collapse" data-target="#74c514e69f54be8ad802a36dc9353a52" class="pull-right">Toggle</a></li><li id="74c514e69f54be8ad802a36dc9353a52" class="list-group-item panel-collapse collapse"><div class="description"></div><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span><br></code></pre><h5>Body</h5><pre><code>{
<span class="hljs-string">"numFound"</span>: <span class="hljs-number">34</span>,
<span class="hljs-string">"start"</span>: <span class="hljs-number">0</span>,
<span class="hljs-string">"maxScore"</span>: <span class="hljs-number">0.876</span>,
<span class="hljs-string">"docs"</span>: [
{
<span class="hljs-string">"score"</span>: <span class="hljs-number">0.625</span> -- <span class="hljs-literal">on</span> a scale <span class="hljs-keyword">of</span> <span class="hljs-number">0</span> to <span class="hljs-number">1</span>, how closely <span class="hljs-keyword">this</span> <span class="hljs-built_in">document</span> matched the query --
<span class="hljs-string">"data_source"</span>: <span class="hljs-string">"FBO"</span>, -- the source <span class="hljs-keyword">of</span> <span class="hljs-keyword">this</span> opportunity --
<span class="hljs-string">"solnbr"</span>: <span class="hljs-string">"ABC-1234567"</span>, -- opportunity<span class="hljs-string">'s unique identifier within the data source --
"id": "FBO:COMBINE:ABC-1234567", -- this document'</span>s unique identifier <span class="hljs-keyword">in</span> the FBOpen search index --
<span class="hljs-string">"title"</span>: <span class="hljs-string">"Super-Duper Mobile App"</span>,
<span class="hljs-string">"listing_url"</span>: <span class="hljs-string">"https://www.fbo.gov/spg/ODA/DARPA/CMO/DARPA-BAA-14-05/listing.html"</span>, -- link to the listing-<span class="hljs-keyword">of</span>-record <span class="hljs-keyword">for</span> <span class="hljs-keyword">this</span> opportunity --
<span class="hljs-string">"close_dt"</span>: <span class="hljs-string">"2013-12-01T17:00:00Z"</span>, -- date/time <span class="hljs-keyword">when</span> applications are due --
<span class="hljs-string">"posted_dt"</span>: <span class="hljs-string">"2013-11-06T00:00:00Z"</span>, -- date/time <span class="hljs-keyword">when</span> <span class="hljs-keyword">this</span> opportunity was made public --
<span class="hljs-string">"open_dt"</span>: <span class="hljs-string">"2013-11-09T00:00:00Z"</span>, -- first date/time <span class="hljs-keyword">when</span> applications may be submitted --
<span class="hljs-string">"agency"</span>: <span class="hljs-string">"General Services Administration"</span>,
<span class="hljs-string">"office"</span>: <span class="hljs-string">"Presidential Innovation Fellows"</span>,
<span class="hljs-string">"location"</span>: <span class="hljs-string">"1800 F Street, Washington, DC"</span>,
<span class="hljs-string">"zipcode"</span>: <span class="hljs-string">"20008"</span>,
<span class="hljs-string">"summary"</span>: <span class="hljs-string">"A short executive summary of the opportunity goes here."</span>,
<span class="hljs-string">"description"</span>: <span class="hljs-string">"More details about the opportunity might be included here"</span>,
--
<span class="hljs-attribute">NOTE</span>: Other optional fields may also appear. These will generally be prefixed <span class="hljs-reserved">with</span> the data source.
E.g., <span class="hljs-keyword">for</span> listings imported from FBO, these may <span class="hljs-attribute">include</span>:
FBO_CLASSCOD, FBO_NAICS, FBO_OFFADD, FBO_CONTACT, FBO_SETASIDE, FBO_RECOVERY_ACT,
FBO_ARCHDATE_dt, FBO_POPCOUNTRY, FBO_POPADDRESS, FBO_EMAIL_ADDRESS, FBO_EMAIL_DESC, <span class="hljs-keyword">and</span>/<span class="hljs-keyword">or</span> other fields.
--
<span class="hljs-string">"highlights"</span>: {
<span class="hljs-string">"summary|description|content"</span>: [
<span class="hljs-string">"This chunk of text from the summary, description, or content field will include at least one <highlight>highlighted</highlight> term."</span>
]
}
}
],
<span class="hljs-string">"facets"</span>: {
<span class="hljs-string">"FBO_NAICS"</span>: { -- each key/value pair <span class="hljs-keyword">is</span> a NAICS code paired <span class="hljs-reserved">with</span> the <span class="hljs-comment"># of results matching that NAICS code --</span>
<span class="hljs-string">"111110"</span>: <span class="hljs-number">0</span>,
<span class="hljs-string">"111422"</span>: <span class="hljs-number">0</span>,
-- etc.
},
<span class="hljs-string">"data_source"</span>: { -- each key/valuepair <span class="hljs-keyword">is</span> a data_source paired <span class="hljs-reserved">with</span> the <span class="hljs-comment"># of results matching that data_source --</span>
<span class="hljs-string">"grants.gov"</span>: <span class="hljs-number">610</span>,
<span class="hljs-string">"FBO"</span>: <span class="hljs-number">339</span>
}
}
}
</code></pre></li></ul></section><h4 id="-an-opportunity">An Opportunity <a href="#-an-opportunity"><i class="fa fa-link"></i></a></h4><p>Individual opportunities can be modified if POST functionality is enabled in the API.</p>
<p><strong>In the current version of FBOpen, POST is disabled.</strong></p>
<section id="-an-opportunity-post" class="panel panel-success"><div class="panel-heading"><div style="float:right"><span style="text-transform: lowercase">Add or Update</span></div><div style="float:left"><a href="#-an-opportunity-post" class="btn btn-xs btn-success">POST</a></div><div style="overflow:hidden"><code>/gsa/fbopen/v0/opp</code></div></div><div class="panel-body"><p>Add or update an opportunity in the search index. Required fields are <em>data_source</em>, <em>solnbr</em>, <em>title</em>, <em>listing_url</em>, and <em>close_dt</em>.
(Expand to view example request for sample values.)</p>
<p>You may also add any optional fields. “Core” fields are listed in the GET description above.
Custom fields may be added, as long as they have a “_t” suffix, e.g., <em>mynewfield_t</em>.</p>
</div><ul class="list-group"><li class="list-group-item"><strong>Request</strong><a data-toggle="collapse" data-target="#e59d0c005abfecda43b06eb2b1ca8236" class="pull-right">Toggle</a></li><li id="e59d0c005abfecda43b06eb2b1ca8236" class="list-group-item panel-collapse collapse"><div class="description"></div><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span><br></code></pre><h5>Body</h5><pre><code> {
"<span class="hljs-attribute">data_source</span>": <span class="hljs-value"><span class="hljs-string">"SBIR"</span></span>,
"<span class="hljs-attribute">solnbr</span>": <span class="hljs-value"><span class="hljs-string">"ABC-98765"</span></span>,
"<span class="hljs-attribute">title</span>": <span class="hljs-value"><span class="hljs-string">"Super-Duper Mobile App"</span></span>,
"<span class="hljs-attribute">listing_url</span>": <span class="hljs-value"><span class="hljs-string">"https://www.fbo.gov/spg/ODA/DARPA/CMO/DARPA-BAA-14-05/listing.html"</span></span>,
"<span class="hljs-attribute">close_dt</span>": <span class="hljs-value"><span class="hljs-string">"2013-12-01T17:00:00Z"</span>
</span>}
</code></pre></li><li class="list-group-item"><strong>Response <code>200</code></strong><a data-toggle="collapse" data-target="#870eab990c0bf918c876334fb64cbecb" class="pull-right">Toggle</a></li><li id="870eab990c0bf918c876334fb64cbecb" class="list-group-item panel-collapse collapse"><div class="description"></div><h5>Headers</h5><pre><code><span class="hljs-attribute">Content-Type</span>: <span class="hljs-string">application/json</span><br></code></pre><h5>Body</h5><pre><code> {
<span class="hljs-string">"status"</span>: <span class="hljs-string">"success|fail"</span>,
<span class="hljs-string">"message"</span>: <span class="hljs-string">"some message here"</span>,
<span class="hljs-string">"data"</span>: { -- only <span class="hljs-keyword">if</span> status == <span class="hljs-string">"success"</span> --
<span class="hljs-string">"id"</span>: <span class="hljs-string">"[the newly generated unique ID for this document will appear here if successful]"</span>
}
}
</code></pre></li></ul></section></div></div></div></div></div></div><p style="text-align: center;" class="text-muted">Generated by <a href="https://github.com/danielgtaylor/aglio" class="aglio">aglio</a> on 16 Jun 2014</p><div id="localFile" style="display: none; position: absolute; top: 0; left: 0; width: 100%; color: white; background: red; font-size: 150%; text-align: center; padding: 1em;">This page may not display correctly when opened as a local file. Instead, view it from a web server.
</div></body><script src="//code.jquery.com/jquery-1.11.0.min.js"></script><script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script>(function() {
if (location.protocol === 'file:') {
document.getElementById('localFile').style.display = 'block';
}
}).call(this);
</script><script>(function() {
$('table').addClass('table');
}).call(this);
</script></html>