economy

Search US federal contract awards

Searches individual US federal contract awards (purchase orders, delivery orders, definitive contracts and blanket purchase agreement calls) from USAspending.gov, the official US government source for federal spending. Send at least one of recipient (a company name, matched as text), keyword (matched against the award description), naics or psc. The window defaults to the most recent US federal fiscal year that ended at least 90 days ago, and it matches awards with activity in that window, so start_date can be earlier and amount is the total value obligated to the award so far, not spend inside the window. Results come back under data.items[], each { award_id, generated_id, type, recipient_name, recipient_uei, amount, awarding_agency, awarding_sub_agency, naics, psc, description, start_date, end_date, place_of_performance: { state, city, country }, url }. type is purchase_order, delivery_order, definitive_contract or bpa_call. A foreign award has a null place_of_performance.state. Sorted by amount, largest first, unless you set sort and order. Paginate with page (1 based) or the universal cursor; the response's pagination block carries has_more and next_cursor. data.total is the full number of matching contracts. A search can be paged to 50,000 results (page x limit); a deeper page is a refunded 400, so narrow the filters to reach the rest. No match is a 200 with an empty items and is not billed.

get/economy/government-contracts

Request

  • Base URL: https://www.socialcrawl.dev/v1
  • URL: https://www.socialcrawl.dev/v1/economy/government-contracts
  • Auth: API key in header x-api-key

Query parameters

recipientstring

Company or organisation name to match, up to 120 characters, for example Lockheed Martin. Matched as text against the recipient name, so a short name also finds related entities. (one of: recipient, keyword, naics, psc; at least one required)

keywordstring

Free-text match against award descriptions, 3 to 120 characters. Use it for a topic such as travel that no single industry code captures. (one of: recipient, keyword, naics, psc; at least one required)

naicsstring

Industry filter: one or more NAICS codes, comma-separated (up to 20). Each code must be 2, 4 or 6 digits, and a shorter code matches the whole family, so 4811 covers scheduled air transportation and 48 covers all transportation. (one of: recipient, keyword, naics, psc; at least one required)

pscstring

Product or service code filter: one or more codes, comma-separated (up to 20), 1 to 4 characters each. A shorter code matches the family, so V is all transportation, travel and relocation services and V301 is travel agent services. (one of: recipient, keyword, naics, psc; at least one required)

from_datestring

Start of the window, YYYY-MM-DD, no earlier than 2007-10-01. Defaults to the first day of the most recent US federal fiscal year (1 October to 30 September) that ended at least 90 days ago, because agencies report with a lag and a year that just ended is only partly reported. Send only this and the window runs to today.

to_datestring

End of the window, YYYY-MM-DD. Defaults to the last day of the most recent US federal fiscal year that ended at least 90 days ago (30 September). Send only this and the window starts one year earlier.

type'purchase_order' | 'delivery_order' | 'definitive_contract' | 'bpa_call' | 'all'

Limit to one award type: purchase_order, delivery_order, definitive_contract or bpa_call. all (default) returns all four.

sort'amount' | 'start_date' | 'end_date' | 'recipient'

Sort field: amount (default), start_date, end_date or recipient.

order'asc' | 'desc'

desc (default) or asc.

limitinteger

Awards per page, 1 to 100. Defaults to 25.

pageinteger

Page number, starting at 1. page x limit cannot exceed 50,000, so with limit 100 the last page is 500 and a deeper page is a refunded 400. The universal cursor returned in pagination.next_cursor is the simpler way to continue. Native upstream cursor param. Send the universal cursor instead: the API maps it to this name for you.

cursorstring

Universal pagination cursor. Send pagination.next_cursor from the previous response back verbatim: the API maps it to this endpoint's native page (page style). You never construct, decode, or look up a cursor. Omit it for page 1.

Headers

Cache-Controlstring

Send no-cache to bypass the response cache and force a live fetch. Billed at the normal endpoint cost; the fresh result is written back to cache for the next caller. Only the no-cache directive triggers this. See the Response Schema guide for details.

Idempotency-Keystring

Optional UUID that makes the request safely retriable. The key is reserved atomically per account before billing. A concurrent retry receives 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After of 1 second while the original is young, growing to a quarter of the time it has been running (at most 30); a crashed reservation expires after 5 minutes. A replay keeps the cached payload immutable except for billing metadata: credits_used becomes 0, idempotent_replay becomes true, and credits_remaining is refreshed to the current balance. A known current balance appears in both the body and X-Credits-Remaining header; no balance row resolves to 0. On a transient lookup failure, body credits_remaining is null and X-Credits-Remaining is omitted. Completed outcomes expire after 24 hours. If the claim store is unavailable, the request fails closed before billing. GET endpoints do not combine idempotent replay with Server-Sent Events: use Accept: application/json when sending this header. The unsupported key-plus-SSE combination is rejected before billing.

Response

Successful response

successboolean required

Whether the request succeeded

platformstring required

Platform name

endpointstring required

API endpoint path

credits_usedinteger required

Number of credits consumed

credits_remaininginteger nullable required

Current account balance, or null when this response could not establish one. Free cache hits always return null because they do not establish an authoritative post-request balance. An idempotency replay also returns null when its current-balance lookup fails. It is never a fabricated zero, so a zero here means the account really is empty. The authoritative reading is the one on a billed response, which comes straight from the deduction.

request_idstring required

Unique request identifier for support

cachedboolean required

Whether the response was served from cache

idempotent_replayboolean

True only when this response is an idempotency replay

Example response

{
  "success": true,
  "platform": "economy",
  "endpoint": "/v1/economy/government-contracts",
  "credits_used": 1,
  "credits_remaining": 4999,
  "request_id": "req-abc123",
  "idempotent_replay": true,
  "meta": {
    "hint": {
      "code": "search_multi",
      "message": "You searched \"matcha\" on 3 platforms one call at a time; /v1/search/multi returns each platform's own search rows in one call at the same price per platform, and a platform with no rows is not charged.",
      "method": "GET",
      "path": "/v1/search/multi?query=matcha&platforms=instagram,tiktok,youtube"
    }
  },
  "pagination": {
    "next_cursor": "sc.eyJ2IjoyLCJjIjoiMiIsInAiOiJwYWdlIn0",
    "has_more": true,
    "page_size": 30,
    "stopped_at": "known_id"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.