Command Line Interface (CLI)
Price Checker allows you to automate the submission of analysis tasks by using a Command Line Interface (CLI). If you don’t know what that is, think of people hacking away on 80s style terminals. On modern operating systems we’ve now got:
Windows: cmd | Mac OS: Terminal |
| |
Image courtesy Wikipedia More info: https://en.wikipedia.org/wiki/Cmd.exe | More info: |
Launching cmd
| Launching Terminal
OR
|
Price Checker must already be running with its window open to be able to correctly accept terminal commands and return from them. See Advanced CLI
To queue a run using the terminal, you basically tell the operating system to run Price Checker again with a couple of special parameters, which tell it which file or link to open and what settings to use. Instead of opening another window it will interpret the command accordingly and queue up a new run instead.
This would allow you, for example, to queue up scans for multiple storefronts without manually opening the Amazon Browser, pasting a link, confirming, and repeating.
The most basic command
“C:\Program Files\Price Checker 2\pc2cmd.exe" C:\Users\Me\Documents\supplier.xlsx
This, on Windows, would quite simply tell PC2 to open the file C:\Users\Me\Documents\supplier.xlsx
and show the Run Settings dialog for you to check the columns etc before starting the run.
It is equivalent to clicking “Open a File” and selecting that file on the User Interface.
We can also tell it to open a URL, which would be like opening the Amazon Browser and opening that page, then hitting “check page for products” and “select this page” one after the other:
"C:\Program Files\Price Checker 2\pc2cmd.exe" https://www.amazon.com/s?k=disney
On Mac OS, the same commands would look something like this:
"/Applications/Price Checker 2.app/Contents/Resources/app/pc2cmd" /Users/Me/Documents/supplier.xlsx
"/Applications/Price Checker 2.app/Contents/Resources/app/pc2cmd" https://www.amazon.com/s?k=disney
You can see that the first thing is always the Price Checker executable, while the last parameter following the name of the executable is always the file or link/URL to open. Note how the path to the executable is enclosed in double quotation marks, because it contains spaces. Without the quotation marks you will see an error.
There are additional parameters that allow you to configure the entire run as if you’d done it on the Run Settings screen, and have the job start automatically.
The above are the simplest commands you can run - feel free to try it now. The path to the executable is a default. The CLI Automation screen in PC2 shows it as installed on your own computer.
List of parameters / options
Parameters are added between the executable and the file or URL, i.e.:
“path/to/executable” [options] “path/to/file”
Common options
These apply to both file and browser/URL runs:
Parameter | Description | Run Settings screen equivalent | Default value |
---|---|---|---|
-autostart | Automatically run the file or URL without showing the settings dialog? | Clicking the “start” button | false |
-costProfile | Name of cost profile to use. The name should be enclosed in double quotation marks, e.g. “Ship NY to UK” If you have made changes to the single basic profile, use “Default”. | 9. Cost Profile
| None (Standard FBA, and there will be no calculation of prep, VAT, or shipping) |
-currency | The output currency. Example: -currency USD | 7. Return Profits in | Marketplace Currency, (i.e. same as marketplace being analysed) |
-grabAllVariations | Whether to enable “Grab all Variations” |
| false |
-immediate | Jump the processing queue and run this in parallel to any other jobs in the same region. This can finish some smaller ‘urgent’ runs faster, but it is not advisable to run long jobs in parallel. |
| false |
-keepDuplicates | Turn off duplicate removal | Uncheck the “Remove duplicates” option | false, i.e. |
-outFile | Specify the absolute file system path for where to write the results file, enclosing in quotation marks if it contains spaces. Example: -out “C:\Users\With Space\results.xlsx” | Change Output File and type
| Automatically generated filename (input file + -PC2 and current date suffix), in the same folder as the input file. |
-outType | Keep PC2’s automated output file naming scheme, but specify the file type (xls, xlsx, csv, tab) Example: -outType csv | Change Output File and change extension/file type only
| xlsx |
-reviews | Whether to download Variation Reviews |
| false |
-silent | Suppress modal dialogs, e.g. invalid ID warning. Requires version 2.2.50 or higher | N/A | false |
File run specific parameters
These only apply when opening a file:
Parameter |
| Run Settings screen equivalent | Default value |
---|---|---|---|
-headers | Does the file contain headers? This will in essence make | Check “File has headers” | auto detected |
-idType | The type of ID and analysis, i.e.: | 2. Product ID Type
| auto detected |
-id | The index of the Product ID column, based on a 0 index, i.e.: e.g. -id 0 | 3. Product ID Column
| auto detected |
-cost | The index of the cost-column, based on a 0 index, as above. e.g. -cost 1 means 'costs are in column B | 4. Cost Column
| auto detected |
-pack | The index of the wholesale packaging column, based on a 0 index, as above. e.g. -pack 2 means ‘packaging is in column C’ | 5. Supplier Multipack Column
| auto detected |
-costCurrency | Currency to interpret costs in. e.g. USD, EUR, GBP, CAD, AUD | 6. Costs are in | Marketplace Currency |
-mkt | The marketplace to run against. Example: -mkt DE | The most recently used, or US if never. |
URL / Browser run specific parameters
Parameter |
| Browser equivalent | Default value |
---|---|---|---|
-deepScan | Perform deep scan. | Not cancelling the deep scan | Unlike on the User Interface, this is false by default |
-extract | Only extract products without analysing them. This is faster and allows you to simply list the items returned from a search or storefront. They can later be run (repeatedly) from the file, which is more efficient. |
| false |
-visual | Whether to show the browser during the run, which might help with debugging. | - | false |
Putting it all together
A file run using all arguments could look like this:
"C:\Program Files\Price Checker 2\pc2cmd.exe"
-headers -it UPC -id 2 -cost 3 -costCurrency EUR -mkt UK
-costProfile ”ABC Shipping Ltd” -currency EUR -grabAllVariations
-auto ”\\SharedDrive\Files\AcmeCorp\PriceList\2020.xls”
The above would tell Price Checker to open the file located at\\SharedDrive\Files\AcmeCorp\PriceList\2020.xls
, and-auto
matically run it against-mkt UK
(UK market) with-headers
in the top row ignored, -it UPC
s found in column -id 2
(counting from 0, so 2 means column C in the file),
costs in -costCurrency EUR
found in column -cost 3
(i.e. D),
using the -costProfile
named ABC Shipping Ltd
,
and also using the -grabAllVariations
option.
Locating the Price Checker executable
You can find this on the “CLI Automation” screen within Price Checker 2.
Windows Default | Mac OS Default |
In the default installation the Price Checker 2 executable is found at: "C:\Program Files\Price Checker 2\pc2cmd.exe" Replace | The default on Mac OS will be: "/Applications/Price Checker 2.app/Contents/Resources/app/pc2cmd" If you installed it outside of Applications or changed the app name, just replace Please note that the path is enclosed in double quotation marks. This is because it contains spaces, which would otherwise be interpreted as the end of the excutable and the beginning of the first parameter/option. Alternatively individual spaces can be escaped using a single backslash character ( |