The consultant psychiatrist did 40 working hours and provided 128 hours on call while a member of staff was off sick and their colleague was on leave.
The health board has revealed the cost from 2013 in a freedom of information request.
It said agency staff were only used when there were no other options to provide cover.
A spokesman said the need to hire the locum consultant came at a time when a member of staff was on a period of extended sickness absence.
The spokesman added: "A consultant psychiatrist was hired from an agency to cover one week's annual leave for the remaining consultant.
"The locum consultant undertook 40 normal working hours and provided 128 hours on call for which the cost to the board was £19,305.22. This figure is the gross total paid to the agency and includes 20% VAT."
NHS Western Isles said its spending on temporary agency consultants rose from £452,000 in 2012 to £1.2m in 2014.
Health Secretary Shona Robison said staffing issues in the NHS were being tackled and there was a record number of consultants working in Scotland, and health boards were working hard to recruit more.
She said: "Workforce in the Western Isles is up 3% under this government.
"When the use of agency staff is required, we have long-standing framework contracts in place which allow us to engage staff at nationally agreed rates of pay.
"These contracts are reviewed on a regular basis to ensure they continue to meet the needs of NHS Scotland and health boards have been advised to only use agencies that are on the nationally agree contract.
"We have also established a national supplementary staffing group which will look at the use of all temporary staff and seek to make recommendations on how we can reduce it."
An agency doctor was paid more than £19,000 for a week's work by NHS Western Isles.