The only reason we know anything about all those claims for light bulbs and moat cleaning is that campaigning journalist Heather Brooke has spent the last five years fighting tooth and nail for MPs to come clean about their expenses ...

I've always been in love with old-style investigative journalism. You know those movies in the 1930s and 40s about the press in Chicago featuring hard-bitten hacks with hearts of gold, like Hildy Johnson in His Girl Friday? I always wanted to be that kind of reporter.

I'm not sure if an onslaught of details about bath plugs and porn movies was how I envisioned the great investigation of my career, but then there are high principles at stake behind this week's scandal about the petty enrichment of our members of parliament.

When I first telephoned the House of Commons about expenses, back in 2004, I was working on a book called Your Right to Know, a citizen's guide to using the Freedom of Information Act (just as the law was coming into force). It was my attempt to get back into serious reporting after taking a break to study literature and write for kids' magazines.

When I made that call, I didn't intend to bring a plague on all politicians' houses. But I was interested in our opaque parliamentary expenses system, having learned about the highly transparent system of political expenses in Washington state; when I was there in 1992 as a student reporter I'd been able to access my local politicians' receipts in a matter of days.

Little did I realise that this simple request to the Commons would end up becoming a five-year investigation, and take me to the high court and back. That first day, it took some time to navigate the parliamentary switchboard and find someone who knew what I was talking about when I asked about freedom of information. (Surprising, when you consider the law had actually been passed in 2000 and the five-year preparation time was the longest for any country - ever.) Eventually, I found someone who dealt with FOI but when I explained that I was after a breakdown of MPs' expenses I was met with baffled silence. A while later I was told that the expenses would be published in October 2004.

Well, the expenses duly came out. But they were bulk figures in various categories: travel, staff, second homes etc. I wanted the detail. That's where you find the truth. But the Commons would not consider letting the public see this. In fact, they would not even discuss how the system of expenses operated. I thought this was strange and it made me suspicious. After all, if the system worked well, why wouldn't they feel confident about explaining it to me?

So I began filing my first freedom of information requests. These are simply letters or emails written to the FOI officer of the Commons laying out what you want to know. You can make these requests to all public bodies and they have 20 working days to respond - though many exceed the deadline and are not punished for it. If they refuse, you can appeal internally and then to the outside regulator, the information commissioner.

I did one request for travel information (refused), then for the names and salaries of MPs' staff (this was blocked personally by Speaker Michael Martin) and then finally one for information on second homes. Initially I asked for the details for all MPs, but this was refused, so then I narrowed it down to 10 - the leaders of the parties and a few ministers.

This was in 2006. My request for details on second homes was rejected, but in July that year I took it to the information commissioner, Richard Thomas. He is independent, but appointed and paid for by the government - so exactly how independent is up for debate. My request sat in his in-tray for a year. This is not uncommon and, indeed, two other cases seeking similar details on two other MPs had been languishing even longer (requests brought by Ben Leapman from the Sunday Telegraph and Jonathan Ungoed-Thomas from the Sunday Times). Eventually, our three cases were combined and in June 2007 the commissioner finally made his decision. It pleased no one: he refused to agree to the publication of receipts but thought the allowance could be broken down into more specific categories. The problem was that that would have created even more work for the Commons than publishing the raw data. The Commons appealed, as did I and the other two reporters.

Fortunately, as a campaigner as well as a journalist, I meet a lot of lawyers. One of them was the barrister Hugh Tomlinson QC. He was intrigued by my case and offered to represent me, pro bono, at the information tribunal at which you can appeal against the commissioner's decisions.

When I went into the hearing in February 2008, I was immensely grateful to have him with me, as rallied against me were a posse of lawyers and government officials, including the head of the House of Commons Fees Office Andrew Walker (more on him later), FOI officer Bob Castle, the treasury solicitor and assistant and an outside barrister. All paid for with taxpayers' money.

The small tribunal room in Bedford Square, London, was almost full when I arrived. The Commons people seemed to have taken over the place and it looked as though I might have to sit in the back for my own hearing. I saw an empty chair with papers on the desk and decided to forcefully occupy it.

"You've moved my papers." It was a nasal, supercilious voice; the man bore a strong resemblance to Eric Morecambe. This was, I soon discovered, Andrew Walker himself.

On the stand, Walker described the expense system he oversaw and why the public had no right to see what was going on in his little fiefdom. He gave some excellent quotes as he was questioned by the lawyers:

"MPs should be allowed to carry on their duties free from interference ..."

"Public confidence is not the overriding concern per se ..."

"Transparency will damage democracy."

"What you are doing is preparing a peephole into the private lives of a member, which will either distract them or lead them into additional questions which they feel they have to defend themselves."

Tomlinson questioned Walker, in forensic detail, about the operation of the fees office and what documentation was required for claims as well as what was being done to verify their probity. Here we began to uncover the extent to which MPs were writing their own cheques.

"There is checking where there are receipts. Where there are no receipts there is no checking," Walker said, adding that, "If it's below £250 then the assumption is that it's going to be reasonable."

At that time, MPs could claim up to £250 without receipts. Tomlinson continued to press for details. There was the "food rule" that allowed MPs up to £400 a month with no receipt. This rule was not written down anywhere and Tomlinson asked how was it, then, that MPs knew about it? Walker replied: "My understanding is that members are well aware. I am unable to tell you how they are well aware of it."

Under heavy questioning he let slip the existence of a "John Lewis list", which was used in his office as the final arbiter of what was a reasonable price for white goods and other furnishings.

"May we see this list?" Tomlinson asked.

We could not. However, an FOI request was quickly filed and the list was released a short time later.

Asked if MPs could claim a large plasma TV on expenses, as had been revealed in a Times story, Walker said: "I am glad to say that story was misconceived. It is unlikely we would allow a plasma; we have a price cut-off. A fish tank may be claimable but, interestingly, a claim was brought to my attention, which I rejected, and iPods we reject. iPods are personal items and not something needed to live away from home."

It was good to see they had some standards.

The tribunal members were less than impressed with all this and in ordering full disclosure they described the second-homes expense system as "redolent of a culture very different from that which exists in the commercial sphere or in most other public sector organisations today" and said that, coupled with the very limited nature of the checks, the system "constituted a recipe for confusion, inconsistency and the risk of misuse".

I thought that was the end of it. In a Guardian interview at that time I stated that it would be a bad idea for the Commons to appeal to the high court: "Either way they look foolish, incompetent and so wedded to secrecy they throw money away or there is some incredible scandal they are trying to hide."

It seems I was right on both counts. The speaker turned out to be a stubborn man. His own legal team advised him against going to the high court, so he ditched them and went lawyer-shopping at taxpayers' expense. Not surprisingly, he found a lawyer willing to oblige.

So now I was headed to the high court. This was serious. Costs are generally awarded and can run into the hundreds of thousands of pounds. Was Speaker Martin hoping the threat of bankruptcy would intimidate me? It was easy for him not to worry as he sat in his cloistered chamber (renovated at taxpayer expense) with a publicly subsidised legal team at his disposal.

Fortunately, my case was so strong, and my lawyers so good, that I had confidence I would be all right. But in any case, the solicitor Louis Charalambous found a way for me to take out legal insurance so I would not personally be at financial risk.

It's a unique experience being a party in a high-court case. The barristers all come equipped with grey-flecked cardboard boxes wrapped with their own branded tape. "KBW" for the King's Bench Walk lawyers - now that's classy! It's not just the one barrister either. At the high court, one is not enough. You must have two: a senior and a junior barrister, along with the solicitor, of course. I only had one barrister and solicitor but they were more than enough to outgun the four lawyers from the Commons and the information commissioner (all funded by the taxpayer, remember).

The Commons presented its two favourite arguments: privacy and security. We heard the lawyer twist himself in knots trying to argue how it was an unseemly invasion of MPs' privacy for the public to know how MPs spent public money in the course of their public duties. We heard how MPs would likely be shot in their beds if their second-home addresses were made public. No evidence was put forward to indicate that any of these threats were anything more than the self-important delusions of a paranoid conspiracy theorist. "You haven't put forward any evidence as to the reason. That's the difficulty," the judge had to repeat to the Commons lawyer on more than one occasion.

The hearing ended and on 16 May the judges ruled in my favour stating that the House of Commons expense system had a "shortfall - both in terms of transparency and accountability" and "we have no doubt that the public interest is at stake. We are not here dealing with idle gossip, or public curiosity about what in truth are trivialities. The expenditure of public money through the payment of MPs' salaries and allowances is a matter of direct and reasonable interest to taxpayers."

The Commons announced they would publish all MPs receipts in October 2008, going back several years. Vindication at last! Well, not quite. October came and went and no expenses, not even the usual aggregate totals, appeared. It was as though the public were being punished for daring to question the great and the good.

I queried the Commons and was told that December was the new publication date. That date, too, came and went.

MPs had their extended Christmas vacation. When they came back they had the amazing gall to attempt, for a second time, to pass a law exempting themselves from the freedom of information law.

The Conservatives withdrew support and the measure failed. However, Conservative MP Julian Lewis did succeed in pushing through a law that would exclude MPs' addresses from publication. He used the discredited "security" argument.

The Commons now claimed it was technically too difficult to publish the data any time before July 2009. But the receipts were scanned back in October - so why did MPs only get their copies for correction six weeks ago?

I filmed a Dispatches programme for Channel 4 in April this year in which we painstakingly trawled through the public records. This is the kind of journalism I like doing. But it's almost impossible in this country. There is so little public information made public. Of course, there is another type of journalism more common in Britain and, it would seem, more effective. After all my hard work, the story of MPs' expenses did, of course, go to the Daily Telegraph. Extensive effort poring over documents? No. It was offered the disc containing the raw data, some say for money.

Last Friday the stories began to pour forth.

As a campaigner I was thrilled to see the details finally put into the public domain. This is important information that the public have a right to see. But as a journalist, I was livid. I asked myself - what is the point of doing all that work, going to court, setting a legal precedent, dealing in facts, when every part of the government conspires to reward the hacks who do none of these things?

But I don't begrudge the paper. It is getting the story out in the most cost-effective way possible. What's unforgiveable is that the House of Commons repeatedly obstructed legitimate requests and then delayed the expense publication date and that MPs went so far as to try to exempt themselves from their own law. I wonder, too, how much we would have actually seen if we'd waited for the Commons to publish, given that MPs were given a free hand to black out anything that was "personal" or a danger to their "security". These terms have been so overused by MPs that I've no doubt that items such as cleaning the moat would have been removed for "security" reasons, as would the house-flipping scandal, as an invasion of MPs' privacy.

And now MPs are feeling morose. Tough! They've had plenty of opportunities to do the right thing by parliament and by the people. At every juncture they behaved in the worst possible way. They refused legitimate requests, they wasted public money going to the high court, they delayed publication, they tried to exempt themselves from their own law, they succeeded in passing a law to keep secret their addresses from their constituents so as to hide the house flipping scandal ...

I think in order to begin the clean-up, it is necessary to get rid of those who created the mess in the first place. Only then can we have a parliament of which we are proud.

• Heather Brooke is the author of Your Right to Know, yrtk.org