### GET /data-services/v1/extracts Source: https://open.gsa.gov/api/sam-entity-extracts-api Retrieves entity extract files from SAM.gov based on the provided query parameters. The endpoint supports filtering by file name, file type, sensitivity, frequency, date, and character set. ```APIDOC ## [GET] /data-services/v1/extracts ### Description Retrieves entity extract files from SAM.gov based on the provided query parameters. The endpoint supports filtering by file name, file type, sensitivity, frequency, date, and character set. ### Method GET ### Endpoint https://api.sam.gov/data-services/v1/extracts ### Parameters #### Query Parameters - **api_key** (string) - Required - API key for authentication. - **fileName** (string) - Optional - The name of the extract file to retrieve. - **fileType** (string) - Optional - The type of extract file (e.g., ENTITY, EXCLUSION). - **sensitivity** (string) - Optional - The sensitivity level of the data (e.g., PUBLIC, FOUO, SENSITIVE). - **frequency** (string) - Optional - The frequency of the extract (e.g., DAILY, MONTHLY). - **date** (string) - Optional - The date of the extract in MM/YYYY or MM/DD/YYYY format. - **charset** (string) - Optional - The character set to use (e.g., UTF8). ### Request Example https://api.sam.gov/data-services/v1/extracts?api_key={API KEY}&fileType=ENTITY&sensitivity=PUBLIC&frequency=MONTHLY&date=04/2022 ### Response #### Success Response (200) Returns the requested extract file. #### Response Example No response example provided. ``` -------------------------------- ### GET /api/extracts Source: https://open.gsa.gov/api/sam-entity-extracts-api The Extracts Download API allows users to download SAM entity extract files. It supports query string parameters for filtering by file name, file type, sensitivity, frequency, character set, date, and version. ```APIDOC ## GET /api/extracts ### Description Downloads extract files from the SAM Entity Extracts API. The API supports several optional query string parameters to filter and select the desired extract file. ### Method GET ### Endpoint /api/extracts ### Parameters #### Query Parameters - **api_key** (string) - Required - Identifies and validates API users and their role-based access. - **fileName** (string) - Optional - Must be used on its own. Allows users to provide the extract file name. Examples: SAM_PUBLIC_MONTHLY_V2_20220406.ZIP, SAM_Exclusions_Public_Extract_V2_22096.ZIP, FASCSAOrders23277.CSV - **fileType** (string) - Optional - Must be used if fileName is not specified. Specifies the type of extract to download. Permitted values: ENTITY, EXCLUSION, SCR, BIO - **sensitivity** (string) - Optional - Must not be used with fileName. Provides the desired sensitivity level. Default: PUBLIC. Permitted values: PUBLIC, FOUO, SENSITIVE - **frequency** (string) - Optional - Requests either a DAILY or MONTHLY extract. Default: MONTHLY. Permitted values: DAILY, MONTHLY - **charset** (string) - Optional - Requests either the ASCII or UTF-8 extract character-set. Default: ASCII. Permitted values: ASCII, UTF8, UTF-8. Not applicable for EXCLUSION file type. - **date** (string) - Optional - Selects a specific date of the file. Format: MM/DD/YYYY for Daily files; MM/YYYY for Monthly files. Default: Most recent date, depending on fileType. Examples: 04/06/2022; 04/2022 - **version** (string) - Optional - Selects the file by version. Permitted values: V2 for Public, FOUO and Exclusion extracts; V3 for Sensitive extract. ### Response #### Success Response (200) - The response is the requested extract file (ZIP or CSV). #### Response Example Binary file content (ZIP or CSV). ``` -------------------------------- ### POST /data-services/v1/extracts Source: https://open.gsa.gov/api/sam-entity-extracts-api This snippet documents the POST call to download a sensitive extract from SAM.gov, including required headers and authentication. ```APIDOC ## [POST] /data-services/v1/extracts?fileName= ### Description Downloads a sensitive extract file from SAM.gov. The request must include Basic Auth credentials and an API key. ### Method POST ### Endpoint https://api.sam.gov/data-services/v1/extracts?fileName= ### Parameters #### Query Parameters - **fileName** (string) - Required - The name of the file to download. #### Headers - **X-Api-Key** (string) - Required - A valid API key. - **Content-Type** (string) - Required - Must be "application/json". - **Accept** (string) - Required - Must be "application/zip". - **Authorization** (string) - Required - Basic Auth token (base64 encoded username:password) or use --user with username and password. ### Request Example curl -X POST "https://api.sam.gov/data-services/v1/extracts?fileName=" --header "X-Api-Key: " --header "Content-Type: application/json" --header "Accept: application/zip" --header "Authorization: Basic " --output C:\sample_file.ZIP ### Response #### Success Response (200) - **file** (binary) - The requested extract file in ZIP format. #### Response Example Binary file download. ``` -------------------------------- ### Sensitive extract download POST call using curl Source: https://open.gsa.gov/api/sam-entity-extracts-api Two curl commands for the sensitive extract download POST call. The first uses a basic auth token in the Authorization header; the second uses the --user option with username and password. Both require a valid API key, Content-Type application/json, Accept application/zip, and output to a local file. ```bash curl -X POST "https://api.sam.gov/data-services/v1/extracts?fileName=< fileName >" --header "X-Api-Key: < a valid API Key >" --header "Content-Type: application/json" --header "Accept: application/zip" --header "Authorization: Basic < auth token >" --output C:\sample_file.ZIP ``` ```bash curl -X POST "https://api.sam.gov/data-services/v1/extracts?fileName=< fileName >" --header "X-Api-Key: < a valid API Key >" --header "Content-Type: application/json" --header "Accept: application/zip" --user "< username >:< password >" --output C:\sample_file.ZIP ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.