More than 20 attorneys, registered lobbyists and public relations specialists have spent hundreds of thousands of dollars in a multi-faceted effort to improve South Africa's image in the United States, according to reports on file at the Justice Department.

They show that the South African lobby has contributed to the political campaigns of dozens of senators and representatives and has sponsored all-expense-paid visits to their beleaguered country for political figures, academicians and journalists.

This lobbying effort, which appears to be one of the largest of its kind, is permitted by U.S. statutes.

However Eschel Rhoodie, who formerly directed the South African Department of Information, which funded most of the lobbying here, has charged in London that there was also a secret underside. Millions of dollars were spent clandestinely to influence political, labor and media figures in the United States, Britain, West Germany, Japan and other countries, he has said.

The public reports filed here by registered agents of the South African government show that their operations cost $1.4 million in 1977, the latest year for which totals were available. This included salaries, fees, entertainment, travel and political contributions.

South Africa's principal Washington-based lobbyist, attorney Donald E. de Kieffer, has made campaign gifts of $50 to $500 in recent years to members of Congress from both parties, the records show.

The reports also say that other political donations were made by members of the Wall Street law firm of Shearman and Sterling, which formerly represented South Africa.

Sidney S. Baron and Co., a New York public relations firm, has contributed up to $1,000 to some candidates, including President Carter. The Baron company represents Japanese electronics manufacturers and the Taiwanese government, as well as South Africa.

It is illegal for a candidate for federal office to receive funds from a foreign national. However, lobbyists who are U.S. citizens can contribute money on their own behalf.

Recipients have been spread across the political spectrum, from former senator James Buckley (Cons.-N.Y.) and Rep. Philip M. Crane (R-Ill.) to Sens. George McGovern (D.-S.D.) and Edward M. Kennedy (D-Mass.).

De Kieffer's reports have also listed entertainment expenses running as high as $17,847 for a six-month period.

He said social functions, some of which he held at his home, were attended by representatives "of various American corporations, political organizations and special interest groups."

His reports list policy issues he has discussed with members of Congress, businessmen and others, including investment opportunities in South Africa, a "peaceful and fair solution to the Rhodesian question" and constitutional talks leading to independence for South West Africa (Namibia).

The South Africa Foundation, a privately funded group, has sought to promote its country's opportunities by sponsoring all-expense-paid trips for political figures, journalists and others, the reports show.

Rep. Les Aspin (D-Wis.) and his wife spent several days in South Africa in early 1976 as guests of the foundation, according to the reports.

A spokesman for Aspin told the Times that the congressman had been a classmate at Oxford University of John H. Chettle, the foundation's Washington director, but that Aspin has continued to disagree with the South African government on most issues.

Rep. Richard H. Ichord (D-Mo.), who also was given a free visit to South Africa, accepted his trip only after he determined that the foundation had no government funding, an aide said.

The foundation was criticized last August in a complaint filed by the U.S. Justice Department. The department won a court-approved agreement in which South African sugar lobbyists acknowledged they had secretly financed some trips for members of Congress through the foundation, in violation of House rules.

Former representatives W. R. Poage (D-Tex.), John J. Flynt Jr. (D-Ga.), and George Goodling (R-Pa.), who received these trips, said they knew only that an organization called the South Africa Foundation had provided them with air fare, lodging or other benefits.

The foundation's reports also listed John Davenport, a former assistant managing editor of Fortune magazine, and William Rusher, a columnist and publisher of The National Review, as having received free trips to South Africa.

Davenport said he accepted the trip in order to lecture on American political and economic affairs at two of the country's universities. He said "no government money was involved," and added, "I would not have gone if the South African government had invited me. I think it would have been unethical for a journalist to have taken such a trip."

Rusher was not available for comment, according to his New York office.

De Kieffer said in a report that he, too, had sought to provide "a positive counter position to the often negative publicity developed on South Africa by the American news media."

According to his records, he arranged to have the Rev. Lester Kinsolving, a Washington-based news commentator, receive $1,629 in stock certificates in order to speak at the stockholder meetings of eight U.S. companies.

Kinsolving also toured South Africa with his expenses paid "directly by the South African government," De Kieffer reported.