Finance::Bank::Schwab - Check your account balances at Charles Schwab


version 2.03


  use Finance::Bank::Schwab;
  my @accounts = Finance::Bank::Schwab->check_balance(
      username     => "xxxxxxxxxxxx",
      password     => "12345",
      get_position => 1,

  for ( @accounts ) {
      printf "%20s : %8s / %8s : USD %9.2f USD %9.2f\n",
          $_->name, $_->sort_code, $_->account_no, $_->cash, $_->balance;

      for my $position ( @{ $_->positions } ) {
          printf "# \t%-10s %-10s %10s Shares \@ \$%-15s\n",
      print "\n";



This module provides a rudimentary interface to the Charles Schwab site. You will need either Crypt::SSLeay or IO::Socket::SSL installed for HTTPS support to work. WWW::Mechanize is required. If you encounter odd errors, install Net::SSLeay and it may resolve itself.



  check_balance( usename => $u, password => $p, get_positions => 1 )

Return an array of account objects, one for each of your bank accounts. If the get_positions flag is true then account positions (share counts, prices, etc) will be retrieved as well.



Return the account name, sort code and the account number. The sort code is just the name in this case, but it has been included for consistency with other Finance::Bank::* modules.


Return the account balance as a signed floating point value.


Return the cash balance as a signed floating point value. This is useful if the account has margin borrowing as the balance alone doesn't do justice.


Returns a reference to an array of Finance::Bank::Schwab::Account::Positions objects. Each provides the following method:

  $position->symbol      (String)
  $position->quantity    (Signed Float)
  $position->price       (Signed Float)
  $position->type        (Stock/Bond/Cash/Unknown)


This warning is verbatim from Simon Cozens' Finance::Bank::LloydsTSB, and certainly applies to this module as well.

This is code for online banking, and that means your money, and that means BE CAREFUL. You are encouraged, nay, expected, to audit the source of this module yourself to reassure yourself that I am not doing anything untoward with your banking data. This software is useful to me, but is provided under NO GUARANTEE, explicit or implied.


Simon Cozens for Finance::Bank::LloydsTSB. The interface to this module, some code and the pod were all taken from Simon's module.

Thanks to Ryan Clark <> for contributing the initial implementation of the share count/price/etc retrieval routines.


Mark Grimes <>


This software is copyright (c) 2013 by Mark Grimes <>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.