PHPackages                             marketscan/mscan - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. marketscan/mscan

ActiveLibrary[API Development](/categories/api)

marketscan/mscan
================

MarketScan mScan API wrapper and sample code

v1.0.13(8y ago)17.5k1[1 PRs](https://github.com/jwadhams/marketscan-mscan/pulls)MITPHP

Since Sep 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/jwadhams/marketscan-mscan)[ Packagist](https://packagist.org/packages/marketscan/mscan)[ RSS](/packages/marketscan-mscan/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (15)Used By (0)

MarketScan mScan API client in PHP
==================================

[](#marketscan-mscan-api-client-in-php)

This is a PHP client for the [MarketScan mScan API](http://www.marketscan.com/mScanAPIDocumentation/html/Welcome.htm).

This library is written, maintained, and used by MarketScan customers. For help with this client library, please open an issue or pull request. If you're having credential or other MarketScan problems, please contact their excellent API support team at `mscanapi@marketscan.com`

Getting Started
---------------

[](#getting-started)

You can install this library through Composer:

```
composer require marketscan/mscan
```

In your code, instantiate the API client by passing your Partner ID and Account number to the constructor. Optionally you can pass in the root URL as the third argument.

```
$mscan = new \MarketScan\MScan(
  'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
  '000000',
  'http://integration.marketscan.com/mscanservice/rest/mscanservice.rst/?'
);
```

Commands
--------

[](#commands)

### Looking up vehicles

[](#looking-up-vehicles)

The most powerful way to look up vehicles is using `GetVehiclesByVINParams`.

You can look up a specific vehicle by VIN by passing that as the only parameter:

```
$mscan->GetVehiclesByVINParams('1G1YB2D73G5121725');
```

You can also pass a more detailed query object that uses the MarketScan VIN exploder to search your inventory. [See documentation for details.](http://www.marketscan.com/mScanAPIDocumentation/html/15d771de-6906-4951-9ccf-9d9a97c48269.htm)

```
$mscan->GetVehiclesByVINParams([
  'Vin' => '1G1YB2D73G5',
  'IsNew' => true
]);
```

You can get a complete list of Makes and Models. Each call takes one parameter, if true it returns Makes or Models that are currently New, if false it returns Makes and Models that may be available used (e.g., DMC, Plymouth).

```
$mscan->GetMakes(true);
$mscan->GetModels(true);
```

### Get Manufacturer Information

[](#get-manufacturer-information)

You can get a complete list of supported manufacturers. This information rarely changes and can be cached.

```
$mscan->GetManufacturers();
```

You can also get the manufacturer of a specific vehicle (by MarketScan Vehicle ID):

```
$mscan->GetManufacturer($vehicle_id);
```

### Information About Your Dealership

[](#information-about-your-dealership)

You can look up the code MarketScan uses to describe your region by looking up the ZIP code of your dealership:

```
$mscan->GetMarketByZIP(68123);
```

### Etc.

[](#etc)

The entire API has not yet been mapped to PHP methods yet. (Pull requests are welcome!) If you need an API method that is not yet implemented directly, the general form for API calls is:

```
$mscan->api_request(
  'api method name',
  'GET or POST',
  'string to append to the URL',
  'data to JSON encode and POST in the request body'
);
```

Some of these API actions, especially `RunScan`, offer incredibly fine-grained control. If you need help figuring out what options can be passed, check out [MarketScan's API documentation](http://www.marketscan.com/mScanAPIDocumentation/html/Welcome.htm).

Demo Pages
----------

[](#demo-pages)

The library includes demo code to take a VIN and return a matrix of Lease and Retail Loan payments. To run the demo:

1. Clone this repository
2. In the repo folder, run `composer install` to load dependencies and set up the autoloader.
3. `cp demo/credentials-sample.php demo/credentials.php` then update credentials.php with actual MarketScan credentials from your account team. (This new file will be ignored by git if you commit changes for a pull request.)
4. Start the PHP local server: `php -S localhost:4242 -t demo`
5. Open your browser to

Getting to RunScan
------------------

[](#getting-to-runscan)

There is a lot of good stuff in the MarketScan API, but the very best stuff is in `RunScan` results.

To build your [request object to pass to RunScan](http://www.marketscan.com/mScanAPIDocumentation/html/ed481d63-01f7-38fc-e444-c14233114f11.htm) for a vehicle (assuming you're starting with its VIN):

1. Set `Vehicle.ID` to the value you received from `$mscan->GetVehiclesByVINParams($vin)`
2. Set `AutoRebateParams.ZIP` to the customer's ZIP
3. Set `AutoRebateParams.DealerZIP` to the dealer's ZIP
4. Set `Market` to the dealership's market ID you received from `$mscan->GetMarketByZIP($zip)` (the market ID can be cached indefinitely)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Recently: every ~35 days

Total

14

Last Release

3222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a20e6e10ced1433e8f6c8a137c3abd3897ed284d1c0e397ad656894b93ae9d47?d=identicon)[jwadhams](/maintainers/jwadhams)

---

Top Contributors

[![jwadhams](https://avatars.githubusercontent.com/u/1613739?v=4)](https://github.com/jwadhams "jwadhams (22 commits)")

### Embed Badge

![Health badge](/badges/marketscan-mscan/health.svg)

```
[![Health](https://phpackages.com/badges/marketscan-mscan/health.svg)](https://phpackages.com/packages/marketscan-mscan)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
