go-itunes-search
is a golang wrapper for iTunes Search API , also provides a binary tool for quick search.
See iTunes Search API Document for more details.
go get github.com/Vonng/go-itunes-search
cd $GOPATH/src/github.com/Vonng/go-itunes-search/bin && make install
Simple & handy tools for iTunes App Search & Lookup, source code : bin/itunes.go
Usage of itunes:
-b string
bundleID for lookup eg:com.tencent.xin
-c string
restrict to country. default:CN (default "CN")
-d fetch extra details. default:disabled
-i string
id for lookup. eg:414478124
-l show result in list format
-n int
number of result size. 1~200,default:50 (default 10)
-s string
searching keyword eg:HelloWorld
-
Available language code could refer to ISO 3166-1 alpha-2 , Specify by
-c
-
-d
options provides extra info, requires an extra RoundTrip to corresponding iTunes Store. -
Actually you can fetch basic entry & extra info from two different country.
-
-n
will limit result size, default 50, range from 1 to 200. but fixed to 1 when provideid
orbundleID
-
-l
will tabulate result withiTunesID, BundleID, AppName, Version
only, only available on search -
-s
provides searching keywords, you may refer iTunes Search API Document for more detail -
-i
means lookup iTunes entity byiTunesID
, which is a serial like414478124
ใ -
-d
means lookup iTunes entity byBundleID
, which looks like a domain name:com.MaoTian.XiXiGame
# search keyword `credit` in US Store, return 10 records, list format
$ itunes -s hello -c US -n 10 -l
10 result returned.
+-----------+--------------------------------------+--------------------------------+-------------+
| ITUNESID | BUNDLEID | NAME | VER |
+-----------+--------------------------------------+--------------------------------+-------------+
| 508231856 | com.zello.client.main | Zello Walkie Talkie | 3.40 |
| 582654048 | com.sega.sonicdash | Sonic Dash | 3.7.3 |
| 293778748 | com.namconetworks.pacmanlite | PAC-MAN | 6.4.4 |
| 443904275 | jp.naver.line | LINE | 7.7.0 |
| 518908100 | com.sdeurope.itunes.helloKittyCafeUS | Hello Kitty Cafe! | 1.7.2 |
| 318447346 | com.HalcyonInnovation.HelloVino | Hello Vino: Wine Assistant | 5.0 |
| 949737354 | com.budgestudios.HelloKittyNailSalon | Hello Kitty Nail Salon | 1.1 |
| 505780419 | com.sanrio.HelloKittyWorld | Hello Kitty World - Fun Park | 3.11.0 |
| | | Game | |
| 969589921 | com.budgestudios.HelloKittyLunchBox | Hello Kitty Lunchbox โ Food | 1.3 |
| | | Maker | |
| 690046600 | com.blackberry.bbm1 | BBM | 300.0.15.81 |
+-----------+--------------------------------------+--------------------------------+-------------+
# lookup by iTunesID 414478124 in CHINESE store ,show detail
itunes -i 414478124 -c JP -d
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [software] 414478124 com.tencent.xin ๅพฎไฟก 6.5.13
โ https://itunes.apple.com/cn/app/%E5%BE%AE%E4%BF%A1/id414478124?mt=8&uo=4
โ http://is2.mzstatic.com/image/thumb/Purple128/v4/db/c6/be/dbc6beea-e606-8548-9017-d2cfa3e6c300/source/512x512bb.jpg
โ Price: 0 CNY
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Provider:
โ 614694882 WeChat https://itunes.apple.com/cn/developer/wechat/id614694882?uo=4
โ Tencent Technology (Shenzhen) Company Limited ยฉ Tencent Inc. http://weixin.qq.com
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Genre:
โ 6005 [6005 6007]
โ Social Networking [็คพไบค ๆ็]
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Icon60 : http://is2.mzstatic.com/image/thumb/Purple128/v4/db/c6/be/dbc6beea-e606-8548-9017-d2cfa3e6c300/source/60x60bb.jpg
โ Icon100: http://is2.mzstatic.com/image/thumb/Purple128/v4/db/c6/be/dbc6beea-e606-8548-9017-d2cfa3e6c300/source/100x100bb.jpg
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Environ:
โ System : 8.0
โ Features : [iosUniversal]
โ Devices : [iPad23G-iPad23G iPad2Wifi-iPad2Wifi iPad611-iPad611 iPad612-iPad612 iPad71-iPad71 iPad72-iPad72 iPad73-iPad73 iPad74-iPad74 iPadAir-iPadAir iPadAir2-iPadAir2 iPadAir2Cellular-iPadAir2Cellular iPadAirCellular-iPadAirCellular iPadFourthGen-iPadFourthGen iPadFourthGen4G-iPadFourthGen4G iPadMini-iPadMini iPadMini3-iPadMini3 iPadMini3Cellular-iPadMini3Cellular iPadMini4-iPadMini4 iPadMini4Cellular-iPadMini4Cellular iPadMini4G-iPadMini4G iPadMiniRetina-iPadMiniRetina iPadMiniRetinaCellular-iPadMiniRetinaCellular iPadPro-iPadPro iPadPro97-iPadPro97 iPadPro97Cellular-iPadPro97Cellular iPadProCellular-iPadProCellular iPadThirdGen-iPadThirdGen iPadThirdGen4G-iPadThirdGen4G iPhone4S-iPhone4S iPhone5-iPhone5 iPhone5c-iPhone5c iPhone5s-iPhone5s iPhone6-iPhone6 iPhone6Plus-iPhone6Plus iPhone6s-iPhone6s iPhone6sPlus-iPhone6sPlus iPhone7-iPhone7 iPhone7Plus-iPhone7Plus iPhoneSE-iPhoneSE iPodTouchFifthGen-iPodTouchFifthGen iPodTouchSixthGen-iPodTouchSixthGen]
โ Languages: [AR DE EN ES FR HE HI ID IT JA KO MS PL PT RU TH TR VI ZH ZH ZH]
โ Platforms: [iPad iPhone iPod iWatch]
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Rating : 12+
โ Reasons: [ๅถๅฐ/่ฝปๅพฎ็่ฒๆ
ๅ
ๅฎนๆ่ฃธ้ฒ]
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Size: 207158272 VppDevice: true GameCenter:false
โ Rating(Current) : 4 / 2435
โ Rating(Historic) : 4 / 818418
โ Sibling Apps : []
โ Related Apps : []
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Screenshots:
http://a1.mzstatic.com/us/r30/Purple128/v4/e1/e4/e2/e1e4e2b0-db07-266b-7d81-b3b3486b473d/screen696x696.jpeg
http://a2.mzstatic.com/us/r30/Purple118/v4/c6/38/4a/c6384adf-0f65-79a8-3862-791404cbef28/screen696x696.jpeg
http://a2.mzstatic.com/us/r30/Purple128/v4/d8/56/af/d856afcd-e9cc-9936-d4f8-cd62e6d1c967/sc1024x768.jpeg
http://a3.mzstatic.com/us/r30/Purple118/v4/90/54/7d/90547d63-3c8b-e788-9ca9-2528a7aa6ed1/screen390x390.jpeg
http://a3.mzstatic.com/us/r30/Purple118/v4/c7/7c/27/c77c278b-385c-0208-158e-e7baf2c66031/screen696x696.jpeg
http://a3.mzstatic.com/us/r30/Purple118/v4/e7/ec/75/e7ec75b9-f6da-5083-d923-27809ddd90c8/screen696x696.jpeg
http://a3.mzstatic.com/us/r30/Purple118/v4/eb/bc/34/ebbc346f-033b-1b0b-0381-2f0d97709522/screen390x390.jpeg
http://a3.mzstatic.com/us/r30/Purple128/v4/33/e2/5f/33e25f99-bca3-1747-db6b-378912b45f0c/sc1024x768.jpeg
http://a4.mzstatic.com/us/r30/Purple118/v4/57/81/b9/5781b924-e6e0-02f2-1cbb-98afdd5e0c06/screen390x390.jpeg
http://a4.mzstatic.com/us/r30/Purple118/v4/db/85/fc/db85fc17-dd73-b461-7430-33b501995aef/sc1024x768.jpeg
http://a5.mzstatic.com/us/r30/Purple128/v4/02/9f/17/029f175c-7a83-5b09-9593-07deab91fd77/screen696x696.jpeg
http://a5.mzstatic.com/us/r30/Purple128/v4/03/84/da/0384da46-9b4e-8258-b80d-e618d45d565a/screen390x390.jpeg
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Purchase:
1:ยฅ1.00:ๅๆผไนๅทง
2:ยฅ6.00:้่ถ
3:ยฅ6.00:้ๅๆฐไนๅฉ
4:ยฅ6.00:ๅฐS
5:ยฅ6.00:Hello Kitty
6:ยฅ6.00:Angelababy
7:ยฅ6.00:ๅๅฆAๆขฆ
8:ยฅ6.00:ๆๅ
ๆด
9:ยฅ6.00:ๅ้ๆงๆ ผ็ๅตๅฐ็พ
10:ยฅ6.00:็็็งๆฟ็ซ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Reviews: [
[
"ๅฏ---YQ",
"5ๆ",
"ไธ็ฅๆ็ๅฐฑๆฒกๆไบ",
"่ๅคฉๅ้ๅพ็็ๆถๅ้ๆฉๅๅพ็่ฏไธ่ฝๆพ็คบๅพ็็ๅคงๅฐ๏ผไปฅๅ่ฟๆ็็ฐๅจๅ่ไธ่งไบ่ฟไธชๅ่ฝ๏ผไธชไบบ่งๅพ่ฟๆ ทไธๆฏๅพๆนไพฟ๏ผ่ไธๆๅๅๆๆถๅ่ฟไผๅ็ผฉๅพ็๏ผๅๅบๆฅ็้ฝ็ณๆไบ๏ผๅซไบบๅฎถๆไนๆๅฟซ็ๅไบซ็ๆดป๏ผ๏ผ"
],
[
"่ฟ่พนไผไธไผๆๆฐดๅ",
"4ๆ",
"่ฏดไธชๅฐ็จๅบ็้ฎ้ข๏ผๅธๆ่ฝ่ขซ็ๅฐ",
"ๅฐ็จๅบๆไธไธช้ฎ้ข๏ผๅฐฑๆฏๆไธไธชๆพ็คบๅจ่ๅคฉ้กถ้จ็ๅ่ฝใไฝๆฏๅช่ฆๆๅๅฐๅ
ณ้ญๅพฎไฟก๏ผๆ่
้ๅบ็ปๅฝ๏ผๅ้ๆฐๆๅผ๏ผๅๆฅ่ฎพ็ฝฎๅจ่ๅคฉ้กถ้จ็ๅฐ็จๅบๅฐฑๆฒกไบโฆ้่ฆ้ๆฐ่ฎพ็ฝฎ๏ผๆ่งๅพๅพๅฅๆชๅ๏ผๅ ไธบๅฆๆไฝ ่ฆ่ฎพ็ฝฎ็ฝฎ้กถ๏ผ่ฏๅฎๆฏไฝ ไฝฟ็จ็้ๅธธ้ซ็โฆ้ฃไธบไปไน้ๆฐๆๅผๅฐฑๅๆฒกไบโฆ็ฎๅๆ
ๅตๅบ่ฏฅๅซไธดๆถ็ฝฎ้กถ๏ฝๅ ไธบไป็ๅ
ณ้ญๅนถไธๆฏๆไธป่งๆงๅถ็๏ผๆๆถๅ้ช้ไธไธ๏ผไนๆฒกไบ๏ผๆไฝไฝ้ชไธๅฐฑๅพ็ฆไบ๏ผ้ฃๆๅฐฑไธไผๅป็จๅฐ็จๅบ็ฝฎ้กถ่ฟไธชๅ่ฝ"
],
[
"ๆผณๆตฆๅฐ่ก",
"5ๆ",
"ๅธๆ่ฝๆน่ฟๆถ่็ๆไบๅ่ฝ",
"ๅจๆถ่้้ขไธ่ฝไธ่ฝฝMP3ๆไปถ๏ผๆไธไธช็นๆญคไธ่ฝฝ็ๆ้ฎไฝๆไธๅผ๏ผๆๆถๅ่ฆๆๅไธไบๆถ่้็ๆไปถ้ฝๆฒกๅๆณไธ่ฝฝๅพไธๆนไพฟ๏ผๅธๆ่ฟไธช้ฎ้ข่ฝๅฐฝๅฟซๅพๅฐ่งฃๅณ่ฐข่ฐข"
]
]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Description:
ๅพฎไฟกๆฏไธๆฌพๅ
จๆนไฝ็ๆๆบ้่ฎฏๅบ็จ๏ผๅธฎๅฉไฝ ่ฝปๆพ่ฟๆฅๅ
จ็ๅฅฝๅใๅพฎไฟกๅฏไปฅ(้
่ฟSMS/MMS็ฝ็ป)ๅ้็ญไฟกใ่ฟ่ก่ง้ข่ๅคฉใไธๅฅฝๅไธ่ตท็ฉๆธธๆ๏ผไปฅๅๅไบซ่ชๅทฑ็
็ๆดปๅฐๆๅๅ๏ผ่ฎฉไฝ ๆๅ่ณ็ฎไธๆฐ็็งปๅจ็ๆดปๆนๅผใ
ไธบไปไน่ฆไฝฟ็จๅพฎไฟก๏ผ
โข ๅคๅชไฝๆถๆฏ๏ผๆฏๆๅ้่ง้ขใๅพ็ใๆๆฌๅ่ฏญ้ณๆถๆฏใ
โข ็พค่ๅ้่ฏ๏ผ็ปๅปบ้ซ่พพ500ไบบ็็พค่ๅ้ซ่พพ9ไบบ็ๅฎๆถ่ง้ข่ๅคฉใ
โข ๅ
่ดน่ฏญ้ณๅ่ง้ข่ๅคฉ๏ผๆไพๅ
จ็ๅ
่ดน็้ซ่ดจ้้่ฏใ
โข WeChat Out๏ผ่ถ
ไฝ่ดน็ๆจๆๅ
จ็็ๆๆบๆๅบๅฎ็ต่ฏ๏ผ็ฎๅไป
้ไบ้จๅๅฐๅบ๏ผใ
โข ่กจๆ
ๅๅบ๏ผๆตท้ๅ
่ดนๅจๆ่กจๆ
๏ผๅ
ๆฌ็ญ้จๅก้ไบบ็ฉๅ็ตๅฝฑ๏ผ่ฎฉ่ๅคฉๅๅพๆด็ๅจๆ่ถฃใ
โข ๆๅๅ๏ผไธๅฅฝๅๅไบซๆฏไธช็ฒพๅฝฉ็ฌ้ด๏ผ่ฎฐๅฝ่ชๅทฑ็็ๆดป็นๆปดใ
โข ้็งไฟๆค๏ผไธฅๆ ผไฟๆค็จๆท็้็งๅฎๅ
จ๏ผๆฏๅฏไธไธๆฌพ้่ฟTRUSTe่ฎค่ฏ็ๅฎๆถ้่ฎฏๅบ็จใ
โข ่ฎค่ฏๆฐๆๅ๏ผ้่ฟโ้ท่พพๅ ๆๅโใโ้่ฟ็ไบบโๅโๆไธๆโ่ฎค่ฏๆฐๆๅใ
โข ๅฎๆถไฝ็ฝฎๅ
ฑไบซ๏ผไธๅฅฝๅๅไบซๅฐ็ไฝ็ฝฎ๏ผๆ ้้่ฟ่ฏญ่จๅ่ฏๅฏนๆนใ
โข ๅค่ฏญ่จ๏ผๆฏๆ่ถ
่ฟ20็ง่ฏญ่จ็้ข๏ผๅนถๆฏๆๅคๅฝ่ฏญ่จ็ๆถๆฏ็ฟป่ฏใ
ยท ๅพฎไฟก่ฟๅจ๏ผๆฏๆๆฅๅ
ฅApple Watch ๅiPhoneๅฅๅบทๆฐๆฎ๏ผๅฏ้่ฟโWeRun-WeChatโๅ
ฌไผๅทไธๅฅฝๅไธ่พ้ซไธใ
โข ๆดๅคๅ่ฝ: ๆฏๆ่ทจๅนณๅฐใ่ๅคฉๅฎคๅข็บธ่ชๅฎไนใๆถๆฏๆ้่ชๅฎไนๅๅ
ฌไผๅทๆๅก็ญใ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Support Sites:
{
"WeChat ็ฝ็ซ": "http://weixin.qq.com",
"ๅพฎไฟก ๆฏๆ": "http://weixin.qq.com"
}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ReleaseNotes:
ๆฌๆฌกๆดๆฐ
- ็พค่ตๆ้กตๅฏไปฅๆฅ็ๆ่ฟๆถๅฐ็ๅฐ็จๅบใ
ๆ่ฟๆดๆฐ
- ๅฏไปฅๅฏน่ง้ข่ฟ่ก็ผ่พใ
- ๅฏไปฅ่ฎพ็ฝฎๆๆกๆๅๅ็ไบๅจไธๅ้็ฅใ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Release: 2017-08-07 06:33:21 +0000 UTC
โ Publish: 2011-01-21 01:32:15 +0000 UTC
โ Crawled: 2017-08-10 16:27:52.707293359 +0800 CST m=+0.727757043
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# lookup app by bundleID: com.tencent.smoba in default Store(CN) without extra detail
itunes -b com.tencent.smoba
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [software] 989673964 com.tencent.smoba ็่
่ฃ่ 1.20.1.21
โ https://itunes.apple.com/cn/app/%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80/id989673964?mt=8&uo=4
โ http://is1.mzstatic.com/image/thumb/Purple128/v4/a5/bb/e5/a5bbe51f-5ba0-575d-de94-da6f65deb3a2/source/512x512bb.jpg
โ Price: 0 CNY
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Provider:
โ 446324237 Tencent Mobile Games https://itunes.apple.com/cn/developer/tencent-mobile-games/id446324237?uo=4
โ Shenzhen Tencent Computer Systems Company Limited
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
........(too long)
package provides itunes-search-api wrapper of Golang. with extra support for applications. If you are using PostgreSQL as well, it's very convient to save app data to PG.
import . "github.com/Vonng/go-itunes-search"
search with keyword Hello
& World
๏ผUS AppStore๏ผRestrict media type to Software
๏ผAt more 5 result.
func TestSearch(t *testing.T) {
res, _ := Search([]string{"Hello", "World"}).
Country(US).
App().
Limit(5).
Results()
for _, r := range res {
r.Print()
}
}
result is fetched via .Results
or .Result
๏ผthe latter assert only one result is returned so it returns *Entry
rather than []Entry
ใ
if you know something could used to identify a track, then lookup API may be a better approach.
Instead of specifying term
, you need something like iTunesID (track_id)
, BundleID
(app only), AMG ID
, etcโฆใAnd when using lookup API, there could only be one or zero entry being returned. So the API chain may end with Result
rather than Results
Here's how it works, these lookups may return same results:
Lookup().ID(414478124).Country(CN).Result()
Lookup().BundleID("com.tencent.xin").Result()
Lookup().Set(BundleID, "com.tencent.xin").Result()
other small examples
SearchOne("ไธ็").Country(CN).Entities([]string{Movie,Music}).Results()
SearchOne("Love").Media(Music).Entity(MusicArtist).Limit(5).Results()
Lookup().ID(529479190).Result()
Lookup().Country(GB).ID(529479190).Result()
Lookup().BundleID("com.supercell.magic").Result()
check api_test.go
for more details & examples.
Entry
is naive mapping to iTunes's response structure. iTunes orgnaize everything just like music track.
type Entry struct {
TrackID int64 `json:"trackId"` // Track
TrackName string `json:"trackName"`
TrackCensoredName string `json:"trackCensoredName"`
TrackViewURL string `json:"trackViewUrl"`
BundleID string `json:"bundleId"` // App bundle
ArtistID int64 `json:"artistId"` // Artist
ArtistName string `json:"artistName"`
ArtistViewURL string `json:"artistViewUrl"`
SellerName string `json:"sellerName"` // Seller
SellerURL string `json:"sellerUrl"`
PrimaryGenreID int64 `json:"primaryGenreId"` // Genre
GenreIDs []string `json:"genreIds"`
PrimaryGenreName string `json:"primaryGenreName"`
Genres []string `json:"genres"`
ArtworkURL60 string `json:"artworkUrl60"` // Icon
ArtworkURL100 string `json:"artworkUrl100"`
ArtworkURL512 string `json:"artworkUrl512"`
Price float64 `json:"price"` // Price
Currency string `json:"currency"`
FormattedPrice string `json:"formattedPrice"`
LanguageCodesISO2A []string `json:"languageCodesISO2A"` // Platform
Features []string `json:"features"`
SupportedDevices []string `json:"supportedDevices"`
MinimumOsVersion string `json:"minimumOsVersion"`
TrackContentRating string `json:"trackContentRating"`
ContentAdvisoryRating string `json:"contentAdvisoryRating"` // Rating
Advisories []string `json:"advisories"`
UserRatingCount int64 `json:"userRatingCount"` // Ranking
AverageUserRating float64 `json:"averageUserRating"`
UserRatingCountForCurrentVersion int64 `json:"userRatingCountForCurrentVersion"`
AverageUserRatingForCurrentVersion float64 `json:"averageUserRatingForCurrentVersion"`
Kind string `json:"kind"` // Type
WrapperType string `json:"wrapperType"`
ScreenshotURLs []string `json:"screenshotUrls"` // Screenshots
IpadScreenshotURLs []string `json:"ipadScreenshotUrls"`
AppletvScreenshotURLs []string `json:"appletvScreenshotUrls"`
IsGameCenterEnabled bool `json:"isGameCenterEnabled"` // Flags
IsVppDeviceBasedLicensingEnabled bool `json:"isVppDeviceBasedLicensingEnabled"`
FileSizeBytes string `json:"fileSizeBytes"` // Attribute
Version string `json:"version"`
Description string `json:"description"`
ReleaseNotes string `json:"releaseNotes"`
ReleaseDate string `json:"releaseDate"`
CurrentVersionReleaseDate string `json:"currentVersionReleaseDate"`
}
Entry.Print
print itself in human-friendly format.
for those user who only interested in Application rather than music. github.com/Vonng/go-itunes-search/app
provides a more precise representation of iOS application: App
.
App
is an enhanced version of Entity
.
It provides some additinoal features:
- more friendly & shorter field names.
- fetch extra fields like
InAppPurchase
,Reviews
,RelatedApps
,SupportedSites
, etc... - Parser to fetch extra fields from corresponding country's store.
- ORM Mapping to
PostgreSQL
table defined inapp/app.ddl
, can be used bygo-pg
- Pretty print template
While it introduce two more dependency: goquery
for parsing iTunes Page, go-pg
for Save
function.
type App struct {
ID int64 `sql:",pk"`
Name string
URL string
Icon string
Kind string
Version string
BundleID string
AuthorID int64
AuthorName string
AuthorURL string
VendorName string
VendorURL string
Copyright string // reserved
GenreID int64
GenreName string
Genres []string
GenreIDs []int64
Icon60 string
Icon100 string
Price int64 `sql:",notnull"`
Currency string
System string
Features []string
Devices []string
Languages []string
Platforms []string // reserved
Rating string
Reasons []string
Size int64
CntRating int64
AvgRating float64
CntRatingCurrent int64
AvgRatingCurrent float64
VppDevice bool
GameCenter bool
Screenshots []string
InAppPurchase []string // reserved
SiblingApps []int64 // reserved
RelatedApps []int64 // reserved
SupportSites string // reserved
Reviews string // reserved
Description string
ReleaseNotes string
ReleaseTime time.Time
PublishTime time.Time
CrawledTime time.Time
}
Transform Entry
to App
is simple. Just use App
constructor:
func NewApp(entry *Entry) (app *App)
func NewDetailedApp(entry *Entry, country string) (app *App)
They both do the trick and guaranteed to success. the Latter will also fetch and parse Extra infos and omit error.
app.Save(Pg)
This will save app to database using orm github.com/go-pg/pg
Parsing extra reserved field is simple as :
app.ParseExtras(US)
Following fields may change during parsing, and won't change if parse failed
Copyright
is fetch from left stack on iTunes page.Screenshots
from iTunes page will merge & dedupe with API's results. and do not keep difference of screenshots type: iPad, iPhone, iMessage, AppleTV, etc...
Platforms
is infered from badge, label, screenshots, device list, etc...InAppPurchase
shows selling item represented as a tri-tuple<rank,price,title>
SiblingApps
list iTunesID of apps provides by same developer shows in the app pageRelatedApps
list iTunesID of apps recommend by apple in this app's page.SupportSites
show at bottom of description. k-v json object with title as key, url as value.Reviews
is a quad-tuple represent customer comments:<user,rating,title,content>
- Remove
CensoredName
,FormattedPrice
- Merge
TrackContentRating
&ContentAdvisoryRating
toRating
go get github.com/go-pg/pg
go get github.com/Sirupsen/logrus
go get github.com/PuerkitoBio/goquery
- An apple daemon for crawling iTunes store.
WTFPL