### Technical Migration Guide Source: https://readme.priceapi.com/docs/v2-migration-guide Provides information on the technical migration guide for API version 2, referencing a separate article that details the nuts-and-bolts differences and migration steps. ```APIDOC ## Technical Migration Guide ### Description This section provides a link to a detailed technical migration guide. This guide explains the fundamental differences between API versions and offers instructions on how to migrate existing technical integrations to version 2. ### Method N/A (Informational) ### Endpoint [https://readme.priceapi.com/v2/reference#technical-migration-guide](https://readme.priceapi.com/v2/reference#technical-migration-guide) ### Content The linked article covers the low-level technical changes in the API and provides step-by-step instructions for migrating integrations. ``` -------------------------------- ### GET /jobs/:job_id/download Source: https://readme.priceapi.com/docs/basic-workflow Downloads the results of a finished job. Results can be downloaded in JSON (recommended) or XML format. ```APIDOC ## GET /jobs/:job_id/download ### Description Downloads the results of a finished job. Results can be downloaded in JSON (recommended) or XML format. Job results are only available for 72 hours after the job was requested. ### Method GET ### Endpoint /jobs/:job_id/download ### Parameters #### Path Parameters - **job_id** (string) - Required - The ID of the job whose results to download. #### Query Parameters - **format** (string) - Optional - The desired format for the results. Accepted values are `json` (default) and `xml`. ### Response #### Success Response (200) - Returns the job results in the specified format (JSON or XML). #### Response Example (JSON) ```json [ { "product_name": "Example Product", "price": 19.99, "currency": "USD" } ] ``` ``` -------------------------------- ### GET /jobs/:job_id Source: https://readme.priceapi.com/docs/basic-workflow Polls the status of a specific job. Returns the job's progress and status, which should be 'finished' before downloading results. ```APIDOC ## GET /jobs/:job_id ### Description Polls the status of a specific job. Returns the job's progress and status, which should be 'finished' before downloading results. ### Method GET ### Endpoint /jobs/:job_id ### Parameters #### Path Parameters - **job_id** (string) - Required - The ID of the job to check. ### Response #### Success Response (200) - **job_id** (string) - The ID of the job. - **status** (string) - The current status of the job (e.g., `working`, `finishing`, `finished`). - **progress** (number) - The progress of the job in percentage. #### Response Example ```json { "job_id": "12345abcde", "status": "finished", "progress": 100 } ``` ``` -------------------------------- ### Credit System (Version 2) Source: https://readme.priceapi.com/docs/v2-migration-guide Explains the generalized credit system for version 2, detailing the cost per value and per page based on whether default or modified optional parameters are used. ```APIDOC ## Credit System (Version 2) ### Description The credit system in version 2 has been generalized to accommodate the new flexibility offered by optional parameters. The cost is calculated per value, per page, with different rates depending on whether default parameters are used or if any optional parameters have been modified. ### Pricing Structure - **Default Optional Parameters**: One credit per value, per page. - **Modified Optional Parameters**: Two credits per value, per page. *Optional parameters include: max age, sorting, price range, and category filter.* ### Example Calculation - A job request using default optional parameters and retrieving data for 10 values across 3 pages would cost 10 * 3 * 1 = 30 credits. - A job request modifying the `sort_by` parameter and retrieving data for 10 values across 3 pages would cost 10 * 3 * 2 = 60 credits. ``` -------------------------------- ### Job Refinement Parameters (Version 2) Source: https://readme.priceapi.com/docs/v2-migration-guide This section details the optional parameters available in version 2 to refine job searches, including timeout, max age, max pages, and sorting options. It also touches upon source-specific filters like price range and category. ```APIDOC ## Job Refinement Parameters (Version 2) ### Description This endpoint allows users to refine their job searches using optional parameters such as timeout, maximum age of cached data, maximum number of pages to retrieve, and various sorting options supported by the source. Additionally, source-specific filters like price range and category may be available. ### Method GET (Implied, as these are parameters for refining search results) ### Endpoint `/jobs` (Example endpoint, actual endpoint may vary) ### Parameters #### Query Parameters - **timeout** (integer) - Optional - Specifies the maximum number of minutes for a job to run. Data collection stops if the job exceeds this time, and only collected data is provided. - **max_age** (integer) - Optional - Sets the maximum age (in minutes) for cached data to be used. Replaces `daily_updated` and `realtime` options. - **max_pages** (integer) - Optional - Defines the exact maximum number of pages for paginated content. For example, to get only the first two pages of search results. - **sort_by** (string) - Optional - Allows choosing from various sorting methods supported by the source, enabling original sorting like that of Google Shopping. - **filter** (object) - Optional - Source-specific filters, such as price range or category. ### Request Example ```json { "timeout": 60, "max_age": 1440, "max_pages": 5, "sort_by": "price_asc", "filter": { "price_min": 10, "price_max": 100, "category": "electronics" } } ``` ### Response #### Success Response (200) - **data** (array) - The collected data based on the specified refinement parameters. - **status** (string) - The status of the job. #### Response Example ```json { "data": [ { "title": "Example Product", "price": 50, "url": "http://example.com/product" } ], "status": "completed" } ``` ``` -------------------------------- ### POST /jobs Source: https://readme.priceapi.com/docs/basic-workflow Creates a job to collect data. A job specifies the source, country, topic, search key and values, and optional parameters like max_age and max_pages. A job_id is returned upon successful creation. ```APIDOC ## POST /jobs ### Description Creates a job to collect data. A job specifies the source, country, topic, search key and values, and optional parameters like max_age and max_pages. A job_id is returned upon successful creation. ### Method POST ### Endpoint /jobs ### Parameters #### Request Body - **source** (string) - Required - The source from which to collect the data (e.g. `amazon` or `google-shopping`). - **country** (string) - Required - The country in which to collect the data (e.g. `us` for the United States, `gb` for Great Britain or `de` for Germany). - **topic** (string) - Required - The type of information for which to search (e.g. `search_results`, `product`, or `offers`). - **key** (string) - Required - The key by which to search (e.g. search by `gtin` or `term`). - **values** (array of strings) - Required - The values for which to search (e.g. `["5901234123457"]` or `["iPhone 6s blue"]`). - **max_age** (integer or string) - Optional - Indicates how old the data may be. Can be a number in minutes (0 means never use cache, 1440 means up to 24 hours old) or an ISO 8601 time string. - **max_pages** (integer) - Optional - Indicates how many pages of offers you want per product. ### Request Example ```json { "source": "amazon", "country": "us", "topic": "search_results", "key": "term", "values": ["laptop"], "max_age": 1440 } ``` ### Response #### Success Response (200) - **job_id** (string) - The ID of the created job. #### Response Example ```json { "job_id": "12345abcde" } ``` ``` -------------------------------- ### Log API Request and Response Details Source: https://readme.priceapi.com/docs/robustness Logging detailed information about HTTP requests and responses is crucial for debugging. This includes request parameters, response status codes, response bodies, error messages, and timestamps with time zones. This data aids in reproducing and investigating issues. ```json { "success": false, "reason": "unauthorized", "parameter": "token", "comment": "Provide your API key with the parameter 'token'!" } ``` -------------------------------- ### Source Renaming Source: https://readme.priceapi.com/docs/v2-migration-guide Notifies users about the renaming of a specific source from 'google-shopping' to 'google_shopping' in the API. ```APIDOC ## Source Renaming ### Description This update informs users about a change in the naming convention for one of the supported data sources. The source previously known as `"google-shopping"` has been renamed to `"google_shopping"`. ### Details - **Old Name**: `google-shopping` - **New Name**: `google_shopping` ### Impact Ensure that any API requests or configurations referencing this source are updated to use the new name `google_shopping` to avoid errors. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.