question

sekidata avatar image
0 Likes"
sekidata asked

How can I get a plain text item description instead of rich content (HTML)?

I'm using a Browse API /item/ call to retrieve the item description for listings of interest. I'm looking for a way to get the item description as plain text, just like what the eBay iPhone app shows under "Item description from the seller". So basically a text version stripped of all rich content.

getitemdescriptionhtml
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
rick0918 avatar image
0 Likes"
rick0918 answered

It's been a few months now since published, but anyhow, If using PHP, just pass the API response through the strip_tags() function like this:

$stripped_content = strip_tags( $api_response );

echo $stripped_content;

You can use many ways of text formatting in PHP. If using another programming language, then I hope other members can help.

Cheers!


10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.