Name
CountSpares Count the amount of upcoming spare toll-free numbers.
Description
Spare Number Forecast is a feature that uses the SMS/800 History database to determine what numbers will be coming spare in the near future.

CountSpares counts how many toll-free numbers will be coming spare in the near future. The search may be restricted to specific NPAs or toll-free numbers. SMS/800 wildcard patterns (* and &) may be used in the toll-free number field. Start and end dates may be used to restrict the search even more. The following are the allowed fields in reqparams:
npalist A comma-separated list of NPAs to be searched.
dn A single toll-free number or a number pattern. A number pattern contains alphanumerics plus the standard SMS/800 wildcard characters, * and &, plus two additional pattern match characters, ^ and $.

This parameter takes up to seven characters. Note that the NPA is not included in this parameter. If less than seven characters are provided the search function will assume the pattern may appear anywhere in the number. Putting a ^ at the start of the pattern indicates that the pattern must appear at the start of the number. Putting a $ at the end of the pattern indicates that the pattern must appear at the end of the number.

startdate The earliest expected spare date. The format of this value is:
mm/dd/yy
enddate The latest expected spare date. The format of this value is:
mm/dd/yy
trailingdigits The number of digits (0-2) that may be added on to the number to allow longer spelled words. Words may then be up to 9 letters long excluding the NPA. This parameter is optional.
resporg A full or partially specified resporg. This limits the search to numbers whose current resporg matches this resporg. This parameter is optional.

MGI Messages
None.
Results
A CountSpares response is an XML document embedded within the normal API response. A typical XML response will have the following fields.
<msgparams>
<countspares>
<npadata>
<npa>first NPA</npa>
<count>amount found for first NPA</count>
</npadata>
<npadata>
<npa>second NPA</npa>
<count>amount found for second NPA</count>
</npadata>
</countspares>
</msgparams>
Example
The following request parameters will request a count of all 877 numbers coming spare between May 1 and May 7, 2007.
npalist~877;startdate~05/01/07;enddate~05/07/07;